ability to set batch sizes to zero

This commit is contained in:
Jonas Weinz 2018-07-03 15:37:15 +02:00
parent 84aa7f288f
commit 8cbd7cbe90
2 changed files with 4 additions and 4 deletions

View File

@ -144,7 +144,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "6b0243a17f70405fb3bbb83918efd12e",
"model_id": "a4899ee1720f4db4a136a96657f3283a",
"version_major": 2,
"version_minor": 0
},

View File

@ -633,7 +633,7 @@ class trainer(object):
named_steps[s].fit = lambda self, X, y=None: self
named_steps[s].fit_transform = named_steps[s].transform
if batch_size is None:
if batch_size is not None:
for k in keras_batch_fitting_layer:
# forcing batch fitting on keras
disabled_keras_fits[k]=named_steps[k].fit
@ -641,7 +641,7 @@ class trainer(object):
named_steps[k].fit = lambda X, y: named_steps[k].train_on_batch(to_dense_if_sparse(X), y) # ← why has keras no sparse support on batch progressing!?!?!
if batch_size is None:
self.pm.fit(X = self.sdm.X[:max_size], y = self.sdm.y[:max_size])
self.pm.fit(X = self.sdm.X[:max_size], y = self.sdm.y[:max_size], validation_split=0.1, epochs=n_epochs)
else:
n = len(self.sdm.X) // batch_size
for i in range(n_epochs):
@ -659,7 +659,7 @@ class trainer(object):
named_steps[s].fit = disabled_fits[s]
named_steps[s].fit_transform = disabled_fit_transforms[s]
if batch_size is None:
if batch_size is not None:
for k in keras_batch_fitting_layer:
named_steps[k].fit = disabled_keras_fits[k]