Skip to content

Commit

Permalink
minibn: add block-sequential update modes
Browse files Browse the repository at this point in the history
  • Loading branch information
pauleve committed Jan 26, 2021
1 parent ff9692b commit 9ef1c75
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions colomoto/minibn.py
Original file line number Diff line number Diff line change
Expand Up @@ -690,3 +690,16 @@ class SyncUpdateModeDynamics(ElementaryUpdateModeDynamics):
def __init__(self, model):
n = len(model)
super().__init__(model, n, n)

class BlockSequentialUpdateModeDynamics(UpdateModeDynamics):
def __init__(self, sequence, model):
super().__init__(model)
self.sequence = sequence

def __call__(self, x):
y = x.copy()
for I in self.sequence:
z = self.model(y)
for i in I:
y[i] = z[i]
yield y

0 comments on commit 9ef1c75

Please sign in to comment.