forked from uclaacmai/projects-skeleton-code
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
35 lines (26 loc) · 1005 Bytes
/
main.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
import os
import constants
from data.StartingDataset import StartingDataset
from networks.StartingNetwork import StartingNetwork
from train_functions.starting_train import starting_train
def main():
# Get command line arguments
hyperparameters = {"epochs": constants.EPOCHS, "batch_size": constants.BATCH_SIZE}
# TODO: Add GPU support. This line of code might be helpful.
# device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
print("Epochs:", constants.EPOCHS)
print("Batch size:", constants.BATCH_SIZE)
# Initalize dataset and model. Then train the model!
train_dataset = StartingDataset()
val_dataset = StartingDataset()
model = StartingNetwork()
starting_train(
train_dataset=train_dataset,
val_dataset=val_dataset,
model=model,
hyperparameters=hyperparameters,
n_eval=constants.N_EVAL,
)
if __name__ == "__main__":
main()
print("TEST: Reached end of main without anything crashing")