@@ -138,39 +138,6 @@ def ta_action(self, mc_tm_class, clause, ta):
138138
139139 return (ta_state [mc_tm_class , clause , ta // 32 , self .number_of_state_bits - 1 ] & (1 << (ta % 32 ))) > 0
140140
141- def get_state (self ):
142- self .ta_state = np .empty (self .number_of_classes * self .number_of_clauses * self .number_of_ta_chunks * self .number_of_state_bits ).astype (np .uint32 )
143- cuda .memcpy_dtoh (self .ta_state , self .ta_state_gpu )
144- self .clause_weights = np .empty (self .number_of_classes * self .number_of_clauses ).astype (np .uint8 )
145- cuda .memcpy_dtoh (self .clause_weights , self .clause_weights_gpu )
146-
147- return ((self .ta_state , self .clause_weights , self .number_of_classes , self .number_of_clauses , self .number_of_features , self .dim , self .patch_dim , self .number_of_patches , self .number_of_state_bits , self .max_weight , self .number_of_ta_chunks , self .append_negated , self .min_y , self .max_y ))
148-
149- def set_state (self , state ):
150- self .number_of_classes = state [2 ]
151- self .number_of_clauses = state [3 ]
152- self .number_of_features = state [4 ]
153- self .dim = state [5 ]
154- self .patch_dim = state [6 ]
155- self .number_of_patches = state [7 ]
156- self .number_of_state_bits = state [8 ]
157- self .max_weight = state [9 ]
158- self .number_of_ta_chunks = state [10 ]
159- self .append_negated = state [11 ]
160- self .min_y = state [12 ]
161- self .max_y = state [13 ]
162-
163- self .ta_state_gpu = cuda .mem_alloc (self .number_of_classes * self .number_of_clauses * self .number_of_ta_chunks * self .number_of_state_bits * 4 )
164- self .clause_weights_gpu = cuda .mem_alloc (self .number_of_classes * self .number_of_clauses )
165- cuda .memcpy_htod (self .ta_state_gpu , state [0 ])
166- cuda .memcpy_htod (self .clause_weights_gpu , state [1 ])
167-
168- self .X_train = np .array ([])
169- self .Y_train = np .array ([])
170- self .X_test = np .array ([])
171- self .ta_state = np .array ([])
172- self .clause_weights = np .array ([])
173-
174141 # Transform input data for processing at next layer
175142 def transform (self , X ):
176143 number_of_examples = X .shape [0 ]
0 commit comments