Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
olegranmo committed Feb 23, 2022
1 parent 48a9893 commit 923b721
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions examples/MNISTDemoTypeIIIFeedback.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,17 @@

from tmu.tsetlin_machine import TMClassifier

number_of_clauses = 2000
T = number_of_clauses*2.5
clauses = 2000
T = 5000
s = 10.0
number_of_state_bits_ta = 8

(X_train, Y_train), (X_test, Y_test) = mnist.load_data()

X_train = np.where(X_train.reshape((X_train.shape[0], 28*28)) > 75, 1, 0)
X_test = np.where(X_test.reshape((X_test.shape[0], 28*28)) > 75, 1, 0)

tm = TMClassifier(number_of_clauses, T, s, type_iii_feedback=True, number_of_state_bits_ta=8, number_of_state_bits_ind=8, platform='CPU', weighted_clauses=True)
tm = TMClassifier(clauses, T, s, type_iii_feedback=True, number_of_state_bits_ta=number_of_state_bits_ta, number_of_state_bits_ind=8, platform='CPU', weighted_clauses=True)

f = open("mnist_type_iii_feedback_%.1f_%d_%d_%d.txt" % (s, clauses, T, number_of_state_bits_ta), "w+")
print("\nAccuracy over 250 epochs:\n")
Expand Down

0 comments on commit 923b721

Please sign in to comment.