21 lines
No EOL
376 B
Python
21 lines
No EOL
376 B
Python
#!/usr/bin/env python3
|
|
# -*- coding: utf-8 -*-
|
|
"""
|
|
Created on Tue Apr 30 19:58:26 2019
|
|
|
|
@author: francois
|
|
"""
|
|
|
|
import math
|
|
|
|
def sigmoid(x):
|
|
"""
|
|
Sigmoid function evaluated at x
|
|
"""
|
|
return 1/(1 + math.exp(-x))
|
|
|
|
def sigmoid_derivative(x):
|
|
"""
|
|
Derivative of the sigmoid function evaluated at x
|
|
"""
|
|
return math.exp(x)/(math.pow((math.exp(x) + 1),2)) |