<s> from pydsm . indexmatrix import IndexMatrix <EOL> def linear_additive ( v1 , v2 , alpha = <NUM_LIT:0.5> , beta = <NUM_LIT:0.5> ) : <EOL> """<STR_LIT>""" <EOL> compword = str ( v1 . row2word [ <NUM_LIT:0> ] ) + "<STR_LIT:U+0020>" + str ( v2 . row2word [ <NUM_LIT:0> ] ) <EOL> comp = ( alpha * v1 ) + ( beta * v2 ) <EOL> comp . row2word = [ compword ] <EOL> return comp <EOL> def multiplicative ( v1 , v2 , alpha = <NUM_LIT:1> , beta = <NUM_LIT:1> ) : <EOL> """<STR_LIT>""" <EOL> compword = str ( v1 . row2word [ <NUM_LIT:0> ] ) + "<STR_LIT:U+0020>" + str ( v2 . row2word [ <NUM_LIT:0> ] ) <EOL> comp = ( alpha * v1 ) * ( beta * v2 ) <EOL> comp . row2word = [ compword ] <EOL> return comp <EOL> __dsm__ = [ '<STR_LIT>' ] </s>
