# coding: utf-8
import sys

sys.path.append('./ch08/')
sys.path.append('./dataset/')
sys.path.append('./common/')

if __name__ == '__main__':
    from deep_convnet import DeepConvNet
    from mnist import load_mnist
    from trainer import Trainer

    (x_train, t_train), (x_test, t_test) = load_mnist(flatten=False)

    network = DeepConvNet()
    trainer = Trainer(network, x_train, t_train, x_test, t_test,
                      epochs=20, mini_batch_size=100,
                      optimizer='Adam', optimizer_param={'lr': 0.001},
                      evaluate_sample_num_per_epoch=1000)
    trainer.train()

    # パラメータの保存
    network.save_params("deep_convnet_params.pkl")
    print("Saved Network Parameters!")

# coding: utf-8
import sys

sys.path.append('./ch08/')
sys.path.append('./dataset/')
sys.path.append('./common/')

if __name__ == '__main__':
    from deep_convnet import DeepConvNet
    from mnist import load_mnist
    from trainer import Trainer

    (x_train, t_train), (x_test, t_test) = load_mnist(flatten=False)

    network = DeepConvNet()
    trainer = Trainer(network, x_train, t_train, x_test, t_test,
                      epochs=20, mini_batch_size=100,
                      optimizer='Adam', optimizer_param={'lr': 0.001},
                      evaluate_sample_num_per_epoch=1000)
    trainer.train()

    # パラメータの保存
    network.save_params("deep_convnet_params.pkl")
    print("Saved Network Parameters!")

# coding: utf-8 # パラメータの保存