Skip to content

Commit

Permalink
Git track test data
Browse files Browse the repository at this point in the history
Signed-off-by: Jay Wang <jay@zijie.wang>
  • Loading branch information
xiaohk committed Jan 29, 2024
1 parent b1608af commit dfdfdf2
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"publish": "pnpm publish --access=public"
},
"devDependencies": {
"@datastructures-js/heap": "^4.3.3",
"@rollup/plugin-typescript": "^11.1.6",
"@types/d3-random": "^3.0.3",
"@typescript-eslint/eslint-plugin": "^6.19.1",
Expand Down
10 changes: 7 additions & 3 deletions src/mememo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
* @author: Jay Wang (jay@zijie.wang)
*/

import { randomLcg, randomUniform, randomInt } from 'd3-random';
import { comb, getCombinations } from './utils/utils';
import type { RandomUniform, RandomInt } from 'd3-random';
import { randomLcg, randomUniform } from 'd3-random';
import { MinHeap } from '@datastructures-js/heap';

export const add = (a: number, b: number) => {
return a + b;
Expand Down Expand Up @@ -212,6 +211,11 @@ export class HNSW<T = string> {
}
}

/**
* Greedy search the closest neighbor in a layer.
*/
_searchLayer() {}

/**
* Generate a random level for a node using a exponentially decaying
* probability distribution
Expand Down
1 change: 1 addition & 0 deletions test/data/accident-report-embeddings-100.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions test/data/accident-reports-100.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion test/mememo.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { describe, test, expect, beforeEach } from 'vitest';
import { add, HNSW } from '../src/mememo';
import embeddingDataJSON from '../notebooks/data/accident-report-embeddings-100.json';
import embeddingDataJSON from './data/accident-report-embeddings-100.json';

interface EmbeddingData {
embeddings: number[][];
Expand Down

0 comments on commit dfdfdf2

Please sign in to comment.