-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtrain.py
37 lines (27 loc) · 789 Bytes
/
train.py
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
28
29
30
31
32
33
34
35
36
37
import json
from utils.dataset import notMNIST
from model import Classifier
from torch.utils.data import DataLoader
CONFIG_PATH = "./config.json"
if __name__ == "__main__":
with open(CONFIG_PATH) as cb:
config = json.loads(cb.read())
data = notMNIST(
config["train"]["train_data_folder"]
)
model = Classifier(
data,
config["train"]["save_model_name"],
config["train"]["batch_size"]
)
model.train(
config["train"]["epochs"],
config["train"]["learning_rate"]
)
#test_data = notMNIST(
# config["test"]["test_data_folder"]
#)
#model.test(
# test_data,
# config["test"]["classifier"]
#)