Created
August 25, 2019 21:37
-
-
Save mikhailklassen/de9147d2756cc1897bbf400eb54b7d6f to your computer and use it in GitHub Desktop.
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 math | |
# Better activation function | |
def take_umbrella(input_1, input_2, w_1=1.0, w_2=1.0): | |
'''Let input_1 be a probability between 0.0 and 1.0 | |
with 0.0 meaning no chance of rain and 1.0 meaning 100% | |
chance of rain. | |
Let input_2 be a time duration describing minutes spent | |
outdoors.''' | |
input_2 = input_2/1440 | |
activation = (w_1*input_1 + w_2*input_2) / (w_1 + w_2) | |
activation = math.tanh(activation) | |
return activation |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment