GeezerVison is showing github.com — bug fixes · cbfinn/gps@9192ffd
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: python/gps/algorithm/algorithm.py +10-4Lines changed: 10 additions & 4 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -62,10 +62,16 @@ def __init__(self, hyperparams): |
62 | 62 | self.traj_opt = hyperparams['traj_opt']['type']( |
63 | 63 | hyperparams['traj_opt'] |
64 | 64 | ) |
65 | | - self.cost = [ |
66 | | - hyperparams['cost']['type'](hyperparams['cost']) |
67 | | - for _ in range(self.M) |
68 | | - ] |
| 65 | + if type(hyperparams['cost']) == list: |
| 66 | + self.cost = [ |
| 67 | + hyperparams['cost'][i]['type'](hyperparams['cost'][i]) |
| 68 | + for i in range(self.M) |
| 69 | + ] |
| 70 | + else: |
| 71 | + self.cost = [ |
| 72 | + hyperparams['cost']['type'](hyperparams['cost']) |
| 73 | + for _ in range(self.M) |
| 74 | + ] |
69 | 75 | self.base_kl_step = self._hyperparams['kl_step'] |
70 | 76 |
|
71 | 77 | @abc.abstractmethod |
|
Collapse file
Copy file name to clipboardExpand all lines: python/gps/gui/config.py +12-4Lines changed: 12 additions & 4 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -116,10 +116,18 @@ def generate_experiment_info(config): |
116 | 116 | common = config['common'] |
117 | 117 | algorithm = config['algorithm'] |
118 | 118 |
|
119 | | - algorithm_cost_type = algorithm['cost']['type'].__name__ |
120 | | - if (algorithm_cost_type) == 'CostSum': |
121 | | - algorithm_cost_type += '(%s)' % ', '.join( |
122 | | - map(lambda cost: cost['type'].__name__, algorithm['cost']['costs'])) |
| 119 | + if type(algorithm['cost']) == list: |
| 120 | + algorithm_cost_type = algorithm['cost'][0]['type'].__name__ |
| 121 | + if (algorithm_cost_type) == 'CostSum': |
| 122 | + algorithm_cost_type += '(%s)' % ', '.join( |
| 123 | + map(lambda cost: cost['type'].__name__, |
| 124 | + algorithm['cost'][0]['costs'])) |
| 125 | + else: |
| 126 | + algorithm_cost_type = algorithm['cost']['type'].__name__ |
| 127 | + if (algorithm_cost_type) == 'CostSum': |
| 128 | + algorithm_cost_type += '(%s)' % ', '.join( |
| 129 | + map(lambda cost: cost['type'].__name__, |
| 130 | + algorithm['cost']['costs'])) |
123 | 131 | return ( |
124 | 132 | 'exp_name: ' + str(common['experiment_name']) + '\n' + |
125 | 133 | 'alg_type: ' + str(algorithm['type'].__name__) + '\n' + |
|