Last active
March 19, 2019 00:28
-
-
Save Tumurtogtokh/7793060d6b787a25694082446975241b to your computer and use it in GitHub Desktop.
PythonNN_demo001
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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): | |
pass | |
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