minor update: change "self.name"
Browse files- automata.py +4 -3
automata.py
CHANGED
@@ -106,7 +106,6 @@ class SyntheticAutomataDataset(datasets.GeneratorBasedBuilder):
|
|
106 |
|
107 |
class AutomatonSampler:
|
108 |
def __init__(self, data_config):
|
109 |
-
# self.name = name
|
110 |
self.data_config = data_config
|
111 |
|
112 |
if 'seed' in self.data_config:
|
@@ -155,7 +154,6 @@ class GridworldSampler(BinaryInputSampler):
|
|
155 |
"""
|
156 |
def __init__(self, data_config):
|
157 |
super().__init__(data_config)
|
158 |
-
self.name = 'gridworld'
|
159 |
|
160 |
if 'n' not in data_config:
|
161 |
data_config['n'] = 9
|
@@ -166,6 +164,8 @@ class GridworldSampler(BinaryInputSampler):
|
|
166 |
self.n = data_config['n']
|
167 |
self.S = self.n - 1
|
168 |
|
|
|
|
|
169 |
def f(self, x):
|
170 |
x = copy(x)
|
171 |
x[x == 0] = -1
|
@@ -216,7 +216,6 @@ class SymmetricSampler(AutomatonSampler):
|
|
216 |
"""
|
217 |
def __init__(self, data_config):
|
218 |
super().__init__(data_config)
|
219 |
-
self.name = 'symmetric'
|
220 |
|
221 |
if 'n' not in data_config:
|
222 |
data_config['n'] = 5 # Default to S5
|
@@ -229,6 +228,8 @@ class SymmetricSampler(AutomatonSampler):
|
|
229 |
self.n = data_config['n'] # the symmetric group Sn
|
230 |
self.label_type = data_config['label_type']
|
231 |
|
|
|
|
|
232 |
"""
|
233 |
Get states
|
234 |
"""
|
|
|
106 |
|
107 |
class AutomatonSampler:
|
108 |
def __init__(self, data_config):
|
|
|
109 |
self.data_config = data_config
|
110 |
|
111 |
if 'seed' in self.data_config:
|
|
|
154 |
"""
|
155 |
def __init__(self, data_config):
|
156 |
super().__init__(data_config)
|
|
|
157 |
|
158 |
if 'n' not in data_config:
|
159 |
data_config['n'] = 9
|
|
|
164 |
self.n = data_config['n']
|
165 |
self.S = self.n - 1
|
166 |
|
167 |
+
self.name = f'Grid{self.n}'
|
168 |
+
|
169 |
def f(self, x):
|
170 |
x = copy(x)
|
171 |
x[x == 0] = -1
|
|
|
216 |
"""
|
217 |
def __init__(self, data_config):
|
218 |
super().__init__(data_config)
|
|
|
219 |
|
220 |
if 'n' not in data_config:
|
221 |
data_config['n'] = 5 # Default to S5
|
|
|
228 |
self.n = data_config['n'] # the symmetric group Sn
|
229 |
self.label_type = data_config['label_type']
|
230 |
|
231 |
+
self.name = f'S{self.n}'
|
232 |
+
|
233 |
"""
|
234 |
Get states
|
235 |
"""
|