👾 Add some machine learning experiments

This commit is contained in:
Mia Steinkirch 2019-10-27 15:05:11 -07:00
parent cab89257dd
commit 729da96322
60 changed files with 39649 additions and 0 deletions
machine_learning_examples/numpy_examples

View file

@ -0,0 +1,7 @@
class Neuron(object):
# ...
def forward(inputs):
""" assume inputs and weights are 1-D numpy arrays and bias is a number """
cell_body_sum = np.sum(inputs * self.weights) + self.bias
firing_rate = 1.0 / (1.0 + math.exp(-cell_body_sum)) # sigmoid activation function
return firing_rate