Skip to content

Commit

Permalink
added to glossary and fixed syntax issues with activation_functions.py (
Browse files Browse the repository at this point in the history
  • Loading branch information
sagekhanuja authored and bfortuner committed Oct 12, 2019
1 parent f4088cd commit 4df47cc
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
13 changes: 6 additions & 7 deletions code/activation_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@

### Functions ###

def linear(z,m)
def linear(z,m):
return m*z

def elu(z,alpha)
def elu(z,alpha):
return z if z >= 0 else alpha*(e^z -1)

def leakyrelu(z, alpha):
Expand All @@ -24,19 +24,18 @@ def sigmoid(z):
return 1.0 / (1 + np.exp(-z))

def tanh(z):
return (np.exp(z) - np.exp(-z))
/ (np.exp(z) + np.exp(-z))
return (np.exp(z) - np.exp(-z)) / (np.exp(z) + np.exp(-z))




### Derivatives ###

def linear_prime(z,m)
def linear_prime(z,m):
return m

def elu_prime(z,alpha)
return 1 if z > 0 else alpha*e^z
def elu_prime(z,alpha):
return 1 if z > 0 else alpha*np.exp(z)

def leakyrelu_prime(z, alpha):
return 1 if z > 0 else alpha
Expand Down
14 changes: 10 additions & 4 deletions docs/glossary.rst
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,7 @@ Model
.. _glossary_neural_networks:

Neural Networks
A model that, taking inspiration from the brain, is composed of layers (at least one of which is hidden) consisting of simple connected units or neurons followed by nonlinearities.
It can be trained to recognize patterns. Neurons in each layer learn increasingly abstract representations of the data.
Neural Networks are mathematical algorithms modeled after the brain's architecture, designed to recognize patterns and relationships in data.

.. _glossary_normalization:

Expand All @@ -179,7 +178,14 @@ Overfitting
.. _glossary_parameters:

Parameters
Be the first to `contribute! <https://github.com/bfortuner/ml-cheatsheet>`__
Parameters are properties of training data learned by training a machine learning model or classifier. They are adjusted using optimization algorithms and unique to each experiment.

Examples of parameters include:

- weights in an artificial neural network
- support vectors in a support vector machine
- coefficients in a linear or logistic regression


.. _glossary_precision:

Expand Down Expand Up @@ -216,7 +222,7 @@ Regression
.. _glossary_regularization:

Regularization
Contribute a definition!
Regularization is a technique utilized to combat the overfitting problem. This is achieved by adding a complexity term to the loss function that gives a bigger loss for more complex models

.. _glossary_reinforcement_learning:

Expand Down

0 comments on commit 4df47cc

Please sign in to comment.