-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtrain.py
More file actions
45 lines (41 loc) · 1.07 KB
/
train.py
File metadata and controls
45 lines (41 loc) · 1.07 KB
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
38
39
40
41
42
43
44
45
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
from RubiksCube import TrainCubeNN
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='Train a rubik\'s cube model')
parser.add_argument(
'--epochs',
'-e',
help="num of epochs",
type=int, required=True)
parser.add_argument(
'--model-path',
'-m',
help="path where the model will be stored",
type=str,
required=True)
parser.add_argument(
'--samples',
'-s',
help="num of samples",
type=int,
default=100)
parser.add_argument(
'--train-dir',
'-t',
help="dir to train data",
type=str)
parser.add_argument(
'--generate-data',
'-g',
help="generate training data",
default=False,
action='store_true')
args = parser.parse_args()
trainer = TrainCubeNN(
model_path=args.model_path,
n_samples=args.samples,
n_epoch=args.epochs,
gen_data=args.generate_data)
trainer.run()