Skip to main content

'Personal machine/deep learning implementation inspired by sklearn and keras'

Project description

handmadeML

This package is created to merge to sub-projects : handmade-neural-network and handmade-machine-learning The components and logics from both projects should converge

neural-networks

Personal challenge : re-code all the components of a deep learning algo (weights, biais, backprop, etc) and benchmark it with the same architecture on keras on a typical example

The code is inspired by the logic of keras, but is much simpler:

  • common terminology and workflow (model instanciation, model.add_layer, model.fit, model.predict etc..) but simplified (no .compile method for instance)
  • less features implemented
  • less checks, exceptions, tricky cases allowed, etc.
  • probably much less computionaly efficient

We first focus on a classical dense neural network

The following features are implemented :

  • 5 activation functions:
    • relu, tanh (mostly for hidden layers)
    • linear (for regression output)
    • sigmoid, softmax (for classifiction outputs)
  • 4 loss functions:
    • mse, mae (for regression tasks)
    • binary crossentropy (for binary classification tasks)
    • multiclass crossentropy (for multiclassification)
  • gradient descent with back-propagation
  • simple GrandientDescent optimizer only
    • stochastic or mini-batch
    • adjustable learning rate
    • without momentum
  • metric computation at the end of each batch/epoch for monitoring during training
    • only loss functions
  • weights and bias initializers : zeros, ones and glorot_uniform only

To be coded later :

  • regularization:

    • l1, l2, elasticnet
    • on kernels (weights)
  • early stopping on validation data

  • training history tracking

  • momentum for SGD optimizer

  • other metrics (accuracy, roc_auc, etc.)

  • other optimizers

    • adam

To be coded much later :

  • dropout
  • regularization on biais and activity of the neurons
  • other optimizers
    • rmsprop

To be never coded :

  • padding
  • CNN specifics:
    • conv2D layers
    • kernels
    • max pooling layers
    • flatting layer
  • RNN specifics:
    • simple RNN layer
    • masking layer
    • LSTM layer

handmade-machine-learning

Personal challenge : fully re-code some machine learning algos : Random forests (including xgboost), svm, etc..

The code is inspired by the logic of sklearn, but is much simpler:

  • common terminology and workflow (model instanciation, model.add_layer, model.fit, model.predict etc..) but simplified
  • less features implemented
  • less checks, exceptions, tricky cases allowed, etc.
  • probably much less computionaly efficient

Implemented so far:

  • linear classifier :
    • loss options : hinge, squared_hinge (for SVC) and logit (for Logistic regression)
    • penalty options : l1,l2
    • kernel : only linear

Next steps:

  • kernel trick with simple kernels : polynomials, rbf
  • create a pedagogical tutorial notebook about linear SVC

To be coded later :

  • more for svm :

    • Linear SV regressors
    • more hinge options
    • more kernels
  • regressors with ridge/lasso/elasticnet

  • decision trees

    • simple decision trees
    • adaboost/xgboost
  • unsupervized:

    • k-mean
    • pca

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

handmadeML-1.0.tar.gz (272.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

handmadeML-1.0-py3-none-any.whl (14.6 kB view details)

Uploaded Python 3

File details

Details for the file handmadeML-1.0.tar.gz.

File metadata

  • Download URL: handmadeML-1.0.tar.gz
  • Upload date:
  • Size: 272.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.7.7

File hashes

Hashes for handmadeML-1.0.tar.gz
Algorithm Hash digest
SHA256 08eca75afd22104c0cb699027ade283b968db96b926ba6f25138c21268c7713b
MD5 d3043aea150ee05599a07ef543b378c8
BLAKE2b-256 1293f6efa572df0f339d96210c5f16ede28e4d76c8d8b019195c2b14a0fe5121

See more details on using hashes here.

File details

Details for the file handmadeML-1.0-py3-none-any.whl.

File metadata

  • Download URL: handmadeML-1.0-py3-none-any.whl
  • Upload date:
  • Size: 14.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.7.7

File hashes

Hashes for handmadeML-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1b7f1a595672bec451a6311102bbdcd0494b7390bbc9a7ac2b06662601f5572e
MD5 57e54bca05b7d4b8eba9c0f830916697
BLAKE2b-256 06decde277ed7f492b39722957ed26f66a166e1e306a66ee867e2ac69a8e3029

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page