-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathtask.py
36 lines (27 loc) · 965 Bytes
/
task.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
from data_loader.data_loader import TFRecordDataLoader
from models.model import RawModel
from trainers.train import RawTrainer
from utils.utils import get_args, process_config
def init() -> None:
"""
The main function of the project used to initialise all the required classes
used when training the model
"""
# get input arguments
args = get_args()
# get static config information
config = process_config()
# combine both into dictionary
config = {**config, **args}
# initialise model
model = RawModel(config)
# create your data generators for each mode
train_data = TFRecordDataLoader(config, mode="train")
val_data = TFRecordDataLoader(config, mode="val")
test_data = TFRecordDataLoader(config, mode="test")
# initialise the estimator
trainer = RawTrainer(config, model, train_data, val_data, test_data)
# start training
trainer.run()
if __name__ == "__main__":
init()