ift7025-projet/Code/NeuralNetUtils.py
2019-04-30 23:31:50 -04:00

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))