Answer the question
In order to leave comments, you need to log in
How to use a neural network with str?
Hello everyone, how to use a neural network in Python not with numbers but with strings?
import numpy as np
def sigmoid(x):
return 1 / (1 + np.exp(-x))
training_input = np.array()
training_output = np.array().T
np.random.seed(1)
synaptic_weights = 2 * np.random.random((3, 1)) - 1
print("Веса до обучения: ")
print(synaptic_weights)
for i in range(20000):
input_layer = training_input
outputs = sigmoid(np.dot(input_layer, synaptic_weights))
err = training_output - outputs
adjustments = np.dot(input_layer.T, err * (outputs * (1 - outputs)))
synaptic_weights += adjustments
new = np.array([1, 1, 0])
output = sigmoid(np.dot(new, synaptic_weights))
print("Ответ: " + output)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question