Commit 000f50e jseagull
committed
1 parent a92fee4 commit 000f50e Copy full SHA for 000f50e
File tree 2 files changed +8
-9
lines changed
main/java/com/guokr/simbase/store
tests/java/com/guokr/simbase/engine
2 files changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -118,17 +118,16 @@ private void processDeletedEvt(int tgtVecId) {
118
118
}
119
119
}
120
120
121
- public Sorter create (int srcVecId ) {
122
- Sorter sorter = new Sorter (scoring .order (), this .limit );
123
- this .sorters .put (srcVecId , sorter );
124
- this .sorterKeys .add (srcVecId );
125
- return sorter ;
121
+ public void create (int srcVecId ) {
122
+ if (!sorters .containsKey (srcVecId )) {
123
+ Sorter sorter = new Sorter (scoring .order (), this .limit );
124
+ this .sorters .put (srcVecId , sorter );
125
+ this .sorterKeys .add (srcVecId );
126
+ }
126
127
}
127
128
128
129
public void add (int srcVecId , int tgtVecId , float score ) {
129
- if (!sorters .containsKey (srcVecId )) {
130
- create (srcVecId );
131
- }
130
+ create (srcVecId );
132
131
this .sorters .get (srcVecId ).add (tgtVecId , score );
133
132
if (!this .reverseIndexer .containsKey (tgtVecId )) {
134
133
this .reverseIndexer .put (tgtVecId , new TIntArrayList ());
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ public static void setup() throws Exception {
22
22
Map <String , Object > basis = new HashMap <String , Object >();
23
23
Map <String , Object > sparse = new HashMap <String , Object >();
24
24
Map <String , Object > econf = new HashMap <String , Object >();
25
- sparse .put ("accumuFactor" , 0.01 );
25
+ sparse .put ("accumuFactor" , 0.5 );
26
26
sparse .put ("sparseFactor" , 2048 );
27
27
basis .put ("vectorSetType" , "sparse" );
28
28
econf .put ("savepath" , "data" );
You can’t perform that action at this time.
0 commit comments