public void consume ( InMemoryLookupTable < T > srcTable ) { if ( srcTable . vectorLength != this . vectorLength ) throw new IllegalStateException ( "You can't consume lookupTable with different vector lengths" ) ; if ( srcTable . syn0 == null ) throw new IllegalStateException ( "Source lookupTable Syn0 is NULL" ) ; this . resetWeights ( true ) ; AtomicInteger cntHs = new AtomicInteger ( 0 ) ; AtomicInteger cntNg = new AtomicInteger ( 0 ) ; if ( srcTable . syn0 . rows ( ) > this . syn0 . rows ( ) ) throw new IllegalStateException ( "You can't consume lookupTable with built for larger vocabulary without updating your vocabulary first" ) ; for ( int x = 0 ; x < srcTable . syn0 . rows ( ) ; x ++ ) { this . syn0 . putRow ( x , srcTable . syn0 . getRow ( x ) ) ; if ( this . syn1 != null && srcTable . syn1 != null ) this . syn1 . putRow ( x , srcTable . syn1 . getRow ( x ) ) ; else if ( cntHs . incrementAndGet ( ) == 1 ) log . info ( "Skipping syn1 merge" ) ; if ( this . syn1Neg != null && srcTable . syn1Neg != null ) { this . syn1Neg . putRow ( x , srcTable . syn1Neg . getRow ( x ) ) ; } else if ( cntNg . incrementAndGet ( ) == 1 ) log . info ( "Skipping syn1Neg merge" ) ; if ( cntHs . get ( ) > 0 && cntNg . get ( ) > 0 ) throw new ND4JIllegalStateException ( "srcTable has no syn1/syn1neg" ) ; } }
This method consumes weights of a given InMemoryLookupTable