Skip to content

Commit

Permalink
Avoid repeating tryOperations if unnecessary
Browse files Browse the repository at this point in the history
  • Loading branch information
alejandrodemiquel committed May 4, 2020
1 parent 61e7507 commit 54ad23f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,9 @@ def tryOperations(t, c, firstIt=False):
newCandidate = Candidate(c.ops+[op], c.tasks+[copy.deepcopy(cTask)], cScore)
b3c.addCandidate(newCandidate)
if firstIt and str(op)[28:60].startswith(startOps):
if all([np.array_equal(np.array(cTask["train"][s]["input"]), \
t.trainSamples[s].inMatrix.m) for s in range(t.nTrain)]):
continue
newCandidate.generateTask()
tryOperations(t, newCandidate)
#elif str(op)[28:60].startswith(repeatIfPerfect) and c.score - changedPixels == cScore and changedPixels != 0:
Expand Down

0 comments on commit 54ad23f

Please sign in to comment.