minor update: add __info__ to CyclicSampler
Browse files- automata.py +7 -0
automata.py
CHANGED
|
@@ -494,6 +494,13 @@ class CyclicSampler(AutomatonSampler):
|
|
| 494 |
shift_idx = list(range(i, self.n)) + list(range(0, i))
|
| 495 |
self.actions[i] = np.eye(self.n)[shift_idx]
|
| 496 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 497 |
|
| 498 |
def f(self, x):
|
| 499 |
if OLD_PY_VERSION:
|
|
|
|
| 494 |
shift_idx = list(range(i, self.n)) + list(range(0, i))
|
| 495 |
self.actions[i] = np.eye(self.n)[shift_idx]
|
| 496 |
|
| 497 |
+
self.__info__ = 'Cyclic group of n={self.n} states:\n' \
|
| 498 |
+
+f"- Inputs: tokens from 0 to n_actions-1\n" \
|
| 499 |
+
+ "- Labels: the current state.\n" \
|
| 500 |
+
+ "- Config:\n" \
|
| 501 |
+
+ " - n (int): number of states.\n" \
|
| 502 |
+
+ " - n_actions (int): number of actions/generators, which are 0, 1, ..., n_actions-1.\n" \
|
| 503 |
+
+ self.__info__
|
| 504 |
|
| 505 |
def f(self, x):
|
| 506 |
if OLD_PY_VERSION:
|