forked from gr8joo/MVTCAE
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main_robot_actions.py
37 lines (28 loc) · 1.02 KB
/
main_robot_actions.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 sys
import os
import json
import torch
from run_epochs import run_epochs
from utils.filehandling import create_dir_structure
from robot_actions.flags import parser
from robot_actions.experiment import RobotActionsExperiment
if __name__ == '__main__':
FLAGS = parser.parse_args()
use_cuda = torch.cuda.is_available()
FLAGS.device = torch.device('cuda' if use_cuda else 'cpu')
FLAGS.class_dim = 64
FLAGS.style_dim = 32
FLAGS.likelihood = 'normal'
# postprocess flags
if FLAGS.div_weight_uniform_content is None:
FLAGS.div_weight_uniform_content = 1 / (FLAGS.num_mods + 1)
FLAGS.alpha_modalities = [FLAGS.div_weight_uniform_content]
if FLAGS.div_weight is None:
FLAGS.div_weight = 1 / (FLAGS.num_mods + 1)
FLAGS.alpha_modalities.extend([FLAGS.div_weight for _ in range(FLAGS.num_mods)])
print("alpha_modalities:", FLAGS.alpha_modalities)
create_dir_structure(FLAGS)
exp = RobotActionsExperiment(FLAGS)
exp.set_optimizer()
print(FLAGS)
run_epochs(exp)