Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
perceptualrobots committed Aug 5, 2024
1 parent 0c8789b commit 5804969
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions nbs/15_arc.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,7 @@
" \"\"\"\n",
" self.dataset = properties.get('dataset', None)\n",
" self.arc_data = ARCDataProcessor(properties, arc_dict)\n",
" self.runs = properties.get('runs', len(arc_dict['train'])) if 'index' in properties else properties.get('runs', 1) / len(arc_dict['train'])\n",
" self.reset()\n",
"\n",
" def step(self, actions):\n",
Expand All @@ -680,6 +681,10 @@
" self.state, self.info = self.arc_data.get_state()\n",
" \n",
" self.iteration += 1 # Increment iteration\n",
" if self.iteration > self.runs:\n",
" print(self.iteration, self.index)\n",
" self.iteration = 1\n",
" self.done = True\n",
" return self.state, self.fitness, self.done, self.info\n",
"\n",
" def reset(self):\n",
Expand Down
5 changes: 5 additions & 0 deletions pct/arc.py
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,7 @@ def initialise(self, properties, arc_dict):
"""
self.dataset = properties.get('dataset', None)
self.arc_data = ARCDataProcessor(properties, arc_dict)
self.runs = properties.get('runs', len(arc_dict['train'])) if 'index' in properties else properties.get('runs', 1) / len(arc_dict['train'])
self.reset()

def step(self, actions):
Expand All @@ -418,6 +419,10 @@ def step(self, actions):
self.state, self.info = self.arc_data.get_state()

self.iteration += 1 # Increment iteration
if self.iteration > self.runs:
print(self.iteration, self.index)
self.iteration = 1
self.done = True
return self.state, self.fitness, self.done, self.info

def reset(self):
Expand Down

0 comments on commit 5804969

Please sign in to comment.