Esempio n. 1
0
def predict_heinsfeld_autoencoder():
    trn_x, trn_y = read_data('rois_cc200')
    tst_x, tst_y = read_data('rois_cc200', training=False)
    clf = Autoencoder(num_classes=2,
                      dropout=(0.6, 0.8),
                      learning_rate=(0.0001, 0.0001, 0.0005),
                      momentum=0.9,
                      noise=(0.2, 0.3),
                      batch_size=(100, 10, 10),
                      num_epochs=(700, 2000, 100))
    clf.predict(trn_x, trn_y, tst_x, tst_y)
Esempio n. 2
0
    class Agent(agents.random.RandomAgent(epochs)):
        def __init__(self, *args):
            super().__init__(*args)
            self.model = Autoencoder(encoder=self.encode,
                                     shape=self.shape,
                                     beta=1.)

        def act(self, seqs):
            return list(
                zip(*sorted(zip(self.model.predict(seqs), seqs))
                    [-self.batch:]))[1]

        def observe(self, data):
            super().observe(data)
            self.model.fit(*zip(*self.seen.items()), epochs=epochs)