File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -45,4 +45,7 @@ def errors(self, y):
4545 raise NotImplementedError ()
4646
4747 def prediction (self ):
48- return self .y_pred ;
48+ return self .y_pred ;
49+
50+ def posterior (self ):
51+ return self .p_y_given_x ;
Original file line number Diff line number Diff line change @@ -164,6 +164,19 @@ def getLabelFunction(self):
164164 givens = {self .x : in_x },name = 'labels' ,
165165 allow_input_downcast = True )#,on_unused_input='warn')
166166 return fn
167+
168+ def getScoreFunction (self ):
169+ """
170+ Get Function for getting score for each labels
171+
172+ :returns theano.function
173+ A function takes input features
174+ """
175+ in_x = self .x .type ('in_x' );
176+ fn = theano .function (inputs = [in_x ],outputs = self .logLayer .posterior (),
177+ givens = {self .x : in_x },name = 'score' ,
178+ allow_input_downcast = True )#,on_unused_input='warn')
179+ return fn
167180
168181 def __l1Regularization__ (self ,start = 0 ):
169182 """
You can’t perform that action at this time.
0 commit comments