ce0325cb72000af404c2c0b4c3ef1644a66bc0e4,examples/mnist.py,,get_new_model,#Any#Any#,76

Before Change


    new_model.tau = model.tau
    train_data = train_data + train_data
    random.shuffle(train_data)
    acc = new_model.train(train_data, batch_size=100)
    return acc, new_model


def sequential_sgd(model, train_data, check_data, n_iter=5):

After Change




def get_new_model(train_data, model, **kwargs):
    kwargs = dict(kwargs)
    learn_rate = np.random.normal(loc=model.eta, scale=0.0001)
    if learn_rate < 0.0001:
        learn_rate = 0.0001

    kwargs["eta"] = learn_rate
    kwargs["mu"] = min(np.random.normal(loc=model.mu, scale=0.01), 0.99)
    kwargs["rho"] = max(0.0, np.random.normal(loc=model.rho, scale=0.0001))
    kwargs["noise"] = max(0.0, np.random.normal(loc=model.noise, scale=0.001))
    kwargs["dropout"] = np.random.normal(loc=model.dropout, scale=0.01)
    new_model = NeuralNet(model.widths, **kwargs)
    new_model.weights = model.weights
    new_model.tau = model.tau
    train_data = train_data + train_data
    random.shuffle(train_data)
    acc = 0.0
    for X, y in train_data:
        acc += new_model.update(Example.dense(model.nr_class, X, y))
    return acc / len(train_data), new_model


def sequential_sgd(model, train_data, check_data, n_iter=5):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 5

Non-data size: 4

Instances


Project Name: explosion/thinc
Commit Name: ce0325cb72000af404c2c0b4c3ef1644a66bc0e4
Time: 2016-08-23
Author: honnibal+gh@gmail.com
File Name: examples/mnist.py
Class Name:
Method Name: get_new_model


Project Name: autorope/donkeycar
Commit Name: 468b7ab7a48a6712991dcbb4ec399a4dc95bd091
Time: 2016-12-14
Author: wroscoe@gmail.com
File Name: manage.py
Class Name:
Method Name:


Project Name: brilee/MuGo
Commit Name: d688ed0d01d41cbc9b67db6b6cacafee3b11cc16
Time: 2016-07-08
Author: brian.kihoon.lee@gmail.com
File Name: main.py
Class Name:
Method Name: train


Project Name: PyMVPA/PyMVPA
Commit Name: b157150be42a40cd0bd9e7609caadb267133cd4c
Time: 2009-08-19
Author: debian@onerussian.com
File Name: mvpa/tests/test_procrust.py
Class Name: ProcrusteanMapperTests
Method Name: testSimple


Project Name: tensorflow/tensorflow
Commit Name: 6aab1b8d4491fae035aeec06016d3442f165bd4d
Time: 2020-11-11
Author: ruhler@google.com
File Name: tensorflow/compiler/mlir/tfr/examples/mnist/mnist_train.py
Class Name:
Method Name: main