Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
perceptualrobots committed Aug 7, 2024
1 parent f752ab9 commit 0a12d1e
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 7 deletions.
2 changes: 1 addition & 1 deletion nbs/01_putils.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -886,7 +886,7 @@
"#| export\n",
"def get_abs_tol(key):\n",
" # dic = {'evolve': 0.01, 'ARC-evolve' : 0.01, 'ARC-display': 0.01, 'ARC': 0.01}\n",
" dic = { 'ARC-evolve' : 0.001, 'ARC-display': 0.1, 'ARC-change' : 0.001, 'ARC-zero': 0.001}\n",
" dic = { 'ARC-evolve' : 0.001, 'ARC-display': 0.1, 'ARC-change' : 0.001, 'ARC-zero': 0.01}\n",
"\n",
" # if key in dic:\n",
" return dic[key]\n",
Expand Down
3 changes: 3 additions & 0 deletions nbs/04_hierarchy.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,9 @@
" return output\n",
" \n",
"\n",
" def is_environment_terminated(self):\n",
" return self.get_environment().is_environment_terminated()\n",
"\n",
" def set_name(self, name):\n",
" self.name=name \n",
" \n",
Expand Down
3 changes: 3 additions & 0 deletions nbs/05_environments.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@
" \n",
" return out \n",
" \n",
" def is_environment_terminated(self):\n",
" return False\n",
" \n",
" def get_parameters_list(self):\n",
" return [self.name] \n",
" \n",
Expand Down
9 changes: 5 additions & 4 deletions nbs/16_environment_processing.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,10 @@
" if 'index' in environment_properties:\n",
" indstr = str(environment_properties['index'])\n",
" experiment.log_other('index', indstr)\n",
" experiment.log_other('fitness_list', str( [f'{i:4.3f}' for i in self.env_processing_details['fitness_list']]))\n",
" fitness_list = str( [f'{i:4.3f}' for i in self.env_processing_details['fitness_list']])\n",
" experiment.log_other('fitness_list', fitness_list)\n",
" input_set = environment_properties['input_set']\n",
" experiment.log_other('input_set', str(input_set))\n",
" experiment.log_metric('last_gen', self.env_processing_details['last_gen'])\n",
" experiment.log_metric('fitness', self.env_processing_details['fitness'])\n",
" experiment.log_other('test_score', f'{score:4.3f}')\n",
Expand Down Expand Up @@ -627,9 +630,7 @@
"text": [
"G:\\My Drive\\data\\ga\\ARC\\FitnessError-MovingSumError-Mode07\\ga-000.000-s001-1x1-m007-ARC0009-1e1867dd3cfb6967b085ac003458aa46.properties\n",
"{'code': '007bbfb7', 'index': 0, 'dataset': 'test', 'control_set': ['dims'], 'input_set': ['env'], 'history': 10, 'initial': 100}\n",
"Execution time of get_data_for_key: 0.0000 seconds\n",
"Execution time of get_data_for_key: 0.0000 seconds\n",
"Test score 0\n"
"Test score 572\n"
]
},
{
Expand Down
4 changes: 4 additions & 0 deletions pct/_modidx.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,8 @@
'pct/environments.py'),
'pct.environments.ControlEnvironment.get_reward': ( 'environments.html#controlenvironment.get_reward',
'pct/environments.py'),
'pct.environments.ControlEnvironment.is_environment_terminated': ( 'environments.html#controlenvironment.is_environment_terminated',
'pct/environments.py'),
'pct.environments.ControlEnvironment.output_string': ( 'environments.html#controlenvironment.output_string',
'pct/environments.py'),
'pct.environments.ControlEnvironment.parse_obs': ( 'environments.html#controlenvironment.parse_obs',
Expand Down Expand Up @@ -1077,6 +1079,8 @@
'pct.hierarchy.PCTHierarchy.insert_function': ( 'hierarchy.html#pcthierarchy.insert_function',
'pct/hierarchy.py'),
'pct.hierarchy.PCTHierarchy.insert_level': ('hierarchy.html#pcthierarchy.insert_level', 'pct/hierarchy.py'),
'pct.hierarchy.PCTHierarchy.is_environment_terminated': ( 'hierarchy.html#pcthierarchy.is_environment_terminated',
'pct/hierarchy.py'),
'pct.hierarchy.PCTHierarchy.last_step': ('hierarchy.html#pcthierarchy.last_step', 'pct/hierarchy.py'),
'pct.hierarchy.PCTHierarchy.list_link_names': ( 'hierarchy.html#pcthierarchy.list_link_names',
'pct/hierarchy.py'),
Expand Down
5 changes: 4 additions & 1 deletion pct/environment_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,10 @@ def results(self, filepath=None, experiment=None):
if 'index' in environment_properties:
indstr = str(environment_properties['index'])
experiment.log_other('index', indstr)
experiment.log_other('fitness_list', str( [f'{i:4.3f}' for i in self.env_processing_details['fitness_list']]))
fitness_list = str( [f'{i:4.3f}' for i in self.env_processing_details['fitness_list']])
experiment.log_other('fitness_list', fitness_list)
input_set = environment_properties['input_set']
experiment.log_other('input_set', str(input_set))
experiment.log_metric('last_gen', self.env_processing_details['last_gen'])
experiment.log_metric('fitness', self.env_processing_details['fitness'])
experiment.log_other('test_score', f'{score:4.3f}')
Expand Down
3 changes: 3 additions & 0 deletions pct/environments.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ def __call__(self, verbose=False):

return out

def is_environment_terminated(self):
return False

def get_parameters_list(self):
return [self.name]

Expand Down
3 changes: 3 additions & 0 deletions pct/hierarchy.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,9 @@ def __call__(self, verbose=False):
return output


def is_environment_terminated(self):
return self.get_environment().is_environment_terminated()

def set_name(self, name):
self.name=name

Expand Down
2 changes: 1 addition & 1 deletion pct/putils.py
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ def clip_value(val, range):
# %% ../nbs/01_putils.ipynb 43
def get_abs_tol(key):
# dic = {'evolve': 0.01, 'ARC-evolve' : 0.01, 'ARC-display': 0.01, 'ARC': 0.01}
dic = { 'ARC-evolve' : 0.001, 'ARC-display': 0.1, 'ARC-change' : 0.001, 'ARC-zero': 0.001}
dic = { 'ARC-evolve' : 0.001, 'ARC-display': 0.1, 'ARC-change' : 0.001, 'ARC-zero': 0.01}

# if key in dic:
return dic[key]
Expand Down

0 comments on commit 0a12d1e

Please sign in to comment.