def build_model(tparams, options):
weightVector = T.vector('weightVector', dtype=theano.config.floatX)
iVector = T.vector('iVector', dtype='int32')
jVector = T.vector('jVector', dtype='int32')
cost = weightVector * (((tparams['w'][iVector] * tparams['w_tilde'][jVector]).sum(axis=1) + tparams['b'][iVector] + tparams['b_tilde'][jVector] - T.log(weightVector)) ** 2)
return weightVector, iVector, jVector, cost.sum()
评论列表
文章目录