fixed bug in SGD

This commit is contained in:
Nicolo Fusi 2013-01-31 14:33:34 +00:00
parent be8417315c
commit 4c963d1a67

View file

@ -159,6 +159,7 @@ class opt_SGD(Optimizer):
missing_data = self.check_for_missing(self.model.Y) missing_data = self.check_for_missing(self.model.Y)
self.model.Youter = None # this is probably not very efficient self.model.Youter = None # this is probably not very efficient
self.model.YYT = None self.model.YYT = None
step = np.zeros_like(self.model._get_params())
for it in range(self.iterations): for it in range(self.iterations):
if it == 0 or self.self_paced is False: if it == 0 or self.self_paced is False:
@ -168,7 +169,6 @@ class opt_SGD(Optimizer):
b = len(features)/self.batch_size b = len(features)/self.batch_size
features = [features[i::b] for i in range(b)] features = [features[i::b] for i in range(b)]
step = np.zeros_like(self.model._get_params())
LL = [] LL = []
count = 0 count = 0