Пример #1
0
 def weightedExpression(i, db, values):
     unweighted = self.mainFuns[i].theanoExpr(db, values)
     features = self.featureFuns[i].theanoExpr(db, values)
     assert len(unweighted) == 1 and len(
         features) == 1, 'not implemented'
     w = B.true_dot(features[0], self.weights)
     return [unweighted[0] * w[0, 0]]
Пример #2
0
 def theanoExpr(self,env):
     env.binding[self.dst] = B.true_dot(env.binding[self.src], env.db.matrix(self.matmode,self.transpose))
Пример #3
0
 def weightedExpression(i,db,values):
     unweighted = self.mainFuns[i].theanoExpr(db,values)
     features = self.featureFuns[i].theanoExpr(db,values)
     assert len(unweighted)==1 and len(features)==1,'not implemented'
     w = B.true_dot(features[0],self.weights)
     return [unweighted[0]*w[0,0]]
Пример #4
0
 def theanoExpr(self, env):
     env.binding[self.dst] = B.true_dot(
         env.binding[self.src], env.db.matrix(self.matmode, self.transpose))