Add evaluation phase for stochastic layers

This commit is contained in:
AntreasAntoniou 2017-11-07 12:55:23 +00:00
parent 1021afa640
commit a1d92fb92e

View File

@ -80,7 +80,7 @@ class Optimiser(object):
data_mon_vals = OrderedDict([(key + label, 0.) for key data_mon_vals = OrderedDict([(key + label, 0.) for key
in self.data_monitors.keys()]) in self.data_monitors.keys()])
for inputs_batch, targets_batch in dataset: for inputs_batch, targets_batch in dataset:
activations = self.model.fprop(inputs_batch) activations = self.model.fprop(inputs_batch, evaluation=True)
for key, data_monitor in self.data_monitors.items(): for key, data_monitor in self.data_monitors.items():
data_mon_vals[key + label] += data_monitor( data_mon_vals[key + label] += data_monitor(
activations[-1], targets_batch) activations[-1], targets_batch)