Coder Social home page Coder Social logo

nogilnick / pythonml Goto Github PK

View Code? Open in Web Editor NEW
120.0 16.0 114.0 6.21 MB

Artificial neural network classes and tools in Python and TensorFlow.

Home Page: https://nicholastsmith.wordpress.com/

License: MIT License

Python 100.00%
tensorflow deep-learning convolutional-neural-networks mlp-networks python-machine-learning ocr

pythonml's Introduction

pythonml

Repository containing various python machine learning modules. Several of the modules have corresponding blog plosts on my website: https://nicholastsmith.wordpress.com/.

bprop.py

A straightforward impelementation of the backpropagation algorithm for MLP networks. See this blog post for more information.

DeepOCR

An implementation of OCR using TensorFlow. See the related blog post for more details. Sample code (requires a model to be trained):

from skimage.io import imread
#Takes a while to load model
from DeepOCR import ImageToString
A = imread('Foo.png')
S = ImageToString(A)
print(S)

TFANN

A neural network module containing implementations of MLP, and CNN networks in TensorFlow. The classes in the module adhere to the scikit-learn fit, predict, score interface. Install the package using pip.

pip install TFANN

Sample code for building an MLP regression model:

import numpy as np
from TFANN import ANNR

A = np.random.rand(32, 4)
Y = np.random.rand(32, 1)
a = ANNR([4], [('F', 4), ('AF', 'tanh'), ('F', 1)], maxIter = 16, name = 'mlpr1')
a.fit(A, Y)
S = a.score(A, Y)
YH = a.predict(A)

For building an MLP classification model:

import numpy as np
from TFANN import ANNC

A = np.random.rand(32, 4)
Y = np.array((16 * [1]) + (16 * [0]))
a = ANNC([4], [('F', 4), ('AF', 'tanh'), ('F', 2)], maxIter = 16, name = 'mlpc2')
a.fit(A, Y)
S = a.score(A, Y)
YH = a.predict(A)

For building an CNN classification model:

import numpy as np
from TFANN import ANNC

A = np.random.rand(32, 9, 9, 3)
Y = np.array((16 * [1]) + (16 * [0]))
ws = [('C', [3, 3, 3, 4], [1, 1, 1, 1]), ('AF', 'relu'), 
      ('P', [1, 4, 4, 1], [1, 2, 2, 1]), ('F', 16), 
      ('AF', 'relu'), ('F', 2)]
a = ANNC([9, 9, 3], ws, maxIter = 12, name = "cnnc1")
a.fit(A, Y)
S = a.score(A, Y)
YH = a.predict(A)

TheanoANN.py

A neural network module containing implementations of MLP networks in Theano. The classes in the module adhere to the scikit-learn fit, predict, score interface.

pythonml's People

Contributors

nogilnick avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.