Добавление кнопки "домой" и гайда
Build and Push / build (push) Successful in 9s

This commit is contained in:
Dmitry
2026-05-18 15:57:22 +03:00
parent 4c8e7b9762
commit 26f4909ead
4 changed files with 95 additions and 11 deletions
+6 -4
View File
@@ -40,10 +40,12 @@ MAX_HOPFIELD_ITER = 200
def recall_hopfield(weights, input_vec)
current = input_vec.dup
MAX_HOPFIELD_ITER.times do
next_vec = step_hopfield(weights, current)
return current if vectors_equal?(current, next_vec)
next_vec = step_hopfield(weights, current)
iter = 1
while !vectors_equal?(current, next_vec) && iter < MAX_HOPFIELD_ITER
current = next_vec
next_vec = step_hopfield(weights, current)
iter += 1
end
current
next_vec
end