tmu icon indicating copy to clipboard operation
tmu copied to clipboard

Request for a «set_TA_action” method

Open satunheim opened this issue 10 months ago • 5 comments

For the TMCoalescedClassifier I have used the following code to extract TA_actions per clause and weights per clause (per class).

TA_action_array= np.zeros((numberofclauses, numberofliterals), int) for k in range (numberofclauses):
for b in range (numberofliterals): if tm.get_ta_action(k,b) == True: TA_action_array[k,b]=1

Weightarray=np.zeros((numberofclasses, numberofclauses), int) for g in range (numberofclasses): for c in range (numberofclauses): Weightarray[g,c]=tm.get_weight(g,c)

I have used this just for extracting a trained model from the TMU – for use on hardware implementations of the TMCoalescedClassifier.

It would be great if a “set_TA_action” method could be included for the TMU, so it would be possible to manually set individual TA_actions. There is a “set_TA_state” method available, and this can be used. However, one then needs to know the number of TA states. A “set_TA_action” method would be simpler to use, and could potentially be implemented by using the “set_TA_state” to set the TA state either in N (exclude) or N+1 (include).

Furthermore, it would be great if a “set_weight” method could be included so it would be possible to manually explore the influence on individual weights.

This issue is also related to Issue #43.

satunheim avatar Aug 29 '23 15:08 satunheim