Skip to content

Commit

Permalink
Corrected step function
Browse files Browse the repository at this point in the history
  • Loading branch information
AbstractGeek committed Feb 9, 2017
1 parent c1c6617 commit 1eb34a3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions libraries/ANN.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,10 +297,10 @@ def sigmoid(self, x):
def sigmoid_diff(self, output):
''' This is derivative of the sigmoid activation function. '''
return output*(1-output)

def step(self, x, theta=0):
''' This is sigmoid activation function. '''
return 1 if x>theta else -1
return 1 if x >= theta else -1

# Hyperbolic tan activation #
def tanh(self, x):
Expand Down
4 changes: 2 additions & 2 deletions packages/ANN/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,10 +297,10 @@ def sigmoid(self, x):
def sigmoid_diff(self, output):
''' This is derivative of the sigmoid activation function. '''
return output*(1-output)

def step(self, x, theta=0):
''' This is sigmoid activation function. '''
return 1 if x>theta else -1
return 1 if x >= theta else -1

# Hyperbolic tan activation #
def tanh(self, x):
Expand Down

0 comments on commit 1eb34a3

Please sign in to comment.