Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
import numpy as np
from scipy.special import expit as sigmoid
class NeuralNetwork(object):
def __init__(self, input_nodes, hidder_layers, output_nodes, learning_rate):
self.i_nodes = input_nodes
self.h_nodes = hidder_layers
self.o_nodes = output_nodes
self.alpha = learning_rate
# Activation function expit - sigmoid
self.activation_func = lambda x: sigmoid(x)
def train(self, input_list, target_list):
def query(self, input_list):
outputs = self.activation_func(input_list)
return outputs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment