Skip to content

Commit

Permalink
Preparing for recurrent TM
Browse files Browse the repository at this point in the history
  • Loading branch information
olegranmo committed May 9, 2024
1 parent 3e4901e commit 6f6a214
Showing 1 changed file with 34 additions and 10 deletions.
44 changes: 34 additions & 10 deletions tmu/clause_bank/clause_bank.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,18 @@ def calculate_clause_outputs_predict(self, encoded_X, e):
xi_p
)

lib.cb_calculate_clause_outputs_predict_recurrent(
self.ptr_ta_state,
self.number_of_clauses,
self.number_of_literals,
self.number_of_state_bits_ta,
self.number_of_patches,
self.co_p,
xi_p
)

return self.clause_output

if not self.incremental:
lib.cb_calculate_clause_outputs_predict(
self.ptr_ta_state,
Expand All @@ -167,6 +179,7 @@ def calculate_clause_outputs_predict(self, encoded_X, e):
self.co_p,
xi_p
)

return self.clause_output

xi_p = ffi.cast("unsigned int *", encoded_X[e, :].ctypes.data)
Expand Down Expand Up @@ -216,16 +229,27 @@ def calculate_clause_outputs_update(self, literal_active, encoded_X, e):
xi_p
)

lib.cb_calculate_clause_outputs_update(
self.ptr_ta_state,
self.number_of_clauses,
self.number_of_literals,
self.number_of_state_bits_ta,
self.number_of_patches,
self.co_p,
la_p,
xi_p
)
lib.cb_calculate_clause_outputs_update_recurrent(
self.ptr_ta_state,
self.number_of_clauses,
self.number_of_literals,
self.number_of_state_bits_ta,
self.number_of_patches,
self.co_p,
la_p,
xi_p
)
else:
lib.cb_calculate_clause_outputs_update(
self.ptr_ta_state,
self.number_of_clauses,
self.number_of_literals,
self.number_of_state_bits_ta,
self.number_of_patches,
self.co_p,
la_p,
xi_p
)

return self.clause_output

Expand Down

0 comments on commit 6f6a214

Please sign in to comment.