CNNTrainer_mainSimple.py 780 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import logging
import mxnet as mx
import CNNCreator_main_net1
import CNNCreator_main_net2

if __name__ == "__main__":
    logging.basicConfig(level=logging.DEBUG)
    logger = logging.getLogger()
    handler = logging.FileHandler("train.log","w", encoding=None, delay="true")
    logger.addHandler(handler)

    main_net1 = CNNCreator_main_net1.CNNCreator_main_net1()
    main_net1.train(
        batch_size = 100,
        num_epoch = 50,
        optimizer = 'adam',
        optimizer_params = {
            'learning_rate': 0.001        }
    )
    main_net2 = CNNCreator_main_net2.CNNCreator_main_net2()
    main_net2.train(
        batch_size = 100,
        num_epoch = 5,
        optimizer = 'sgd',
        optimizer_params = {
            'learning_rate': 0.1        }
    )