def evaluate():
     for t, pixels in enumerate(testset):
         if pixels is None:
             continue
         estimate = unflatten(rbm.reconstruct(flatten(pixels)))
         errors[t].append(((pixels - estimate)**2).mean())
     report = ' : '.join('%d' % mean(errors[t]) for t in range(10))
     r = numpy.array(recent)
     logging.error('%d<%.3g>: %.3g+%.3g: %s', batches,
                   opts.alpha * numpy.exp(-batches / opts.tau),
                   r.mean(axis=0).mean(),
                   r.std(axis=0).mean(), report)
 def evaluate():
     for t, pixels in enumerate(testset):
         if pixels is None:
             continue
         estimate = unflatten(rbm.reconstruct(flatten(pixels)))
         errors[t].append(((pixels - estimate) ** 2).mean())
     report = " : ".join("%d" % mean(errors[t]) for t in range(10))
     r = numpy.array(recent)
     logging.error(
         "%d<%.3g>: %.3g+%.3g: %s",
         batches,
         opts.alpha * numpy.exp(-batches / opts.tau),
         r.mean(axis=0).mean(),
         r.std(axis=0).mean(),
         report,
     )
Example #3
0
def reconstruct(weights, hid_states):
    for i in range(len(weights) + 1)[1:]:
        hid_states = rbm.reconstruct(weights[-i], hid_states)
    return hid_states
Example #4
0
def reconstruct(weights, hid_states):
    for i in range(len(weights)+1)[1:]:
        hid_states = rbm.reconstruct(weights[-i], hid_states)
    return hid_states