Commits

Jure Žbontar  committed 154d34e

Fixed some bugs, set sane defaults.

  • Participants
  • Parent commits 6f5754a

Comments (0)

Files changed (1)

File _multitarget/neural.py

 
         # Grad
         d3 = a3 - self.y
-        d2 = d3.dot(Theta2)[:, 1:] * sigmoid_gradient(z2)
+        d2 = d3.dot(Theta2)[:, 1:] * _sigmoid_gradient(z2)
 
         D2 = a2.T.dot(d3).T / m
         D1 = a1.T.dot(d2).T / m
             self.__init__(**kwargs)
             return self(data,weight)
 
-    def __init__(self, name="NeuralNetwork",n_mid=10,reg_fact=1,max_iter=10,treshold=0.5):
+    def __init__(self, name="NeuralNetwork",n_mid=10,reg_fact=1,max_iter=1000,treshold=0.5):
         """
         Current default values are the same as in the original implementation (neural_networks.py)
         Currently supports only multi-label data.
 
     def __call__(self,example, result_type=Orange.core.GetValue):
         # transform example to numpy
-        input = numpy.array([[float(e) for e in example]])
+        input = np.array([[float(e) for e in example]])
         # transform results from numpy
         results = self.classifier(input).tolist()[0]
         mt_prob = []
             else:
                 raise ValueError("non-discrete classes not supported")
         
-        if result_type == orange.GetValue: return tuple(mt_value)
-        elif result_type == orange.GetProbabilities: return tuple(mt_prob)
+        if result_type == Orange.classification.Classifier.GetValue: return tuple(mt_value)
+        elif result_type == Orange.classification.Classifier.GetProbabilities: return tuple(mt_prob)
         else: 
             return [tuple(mt_value),tuple(mt_prob)]