-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtrain.py
31 lines (25 loc) · 1.11 KB
/
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
import os
import argparse
import sys
import torch
sys.path.append("src")
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("--name", type=str, default="")
parser.add_argument("-e", "--epochs", type=int, default=70000)
parser.add_argument("-s", "--samples", type=int, default=2500)
parser.add_argument("--test", action="store_true")
parser.add_argument("-on", "--output_name", type=str, default="Schroder.pth")
parser.add_argument("-g", "--gpuid", type=int, default=0)
args = parser.parse_args()
os.environ['CUDA_VISIBLE_DEVICES'] = str(args.gpuid)
if args.name == "NeoHookeanExp":
from experiments.alalytical_experiment.NeoHookeanExp import train
train(epochs=args.epochs, n_samples=args.samples)
print("NeoHookeanExp training finished")
elif args.name == "Schroder":
torch.set_default_dtype(torch.float64)
from experiments.alalytical_experiment.SchroderNeffEbbingExp import train
train(epochs=args.epochs, n_samples=args.samples, output_name = args.output_name)
else:
print("Nothing to be done.")