alison-carrera / onn

Licence: Apache-2.0 license
Online Deep Learning: Learning Deep Neural Networks on the Fly / Non-linear Contextual Bandit Algorithm (ONN_THS)

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to onn

openpose-pytorch
🔥 OpenPose api wrapper in PyTorch.
Stars: ✭ 52 (-62.59%)
Mutual labels:  pytorch-implementation
NASBench-PyTorch
A PyTorch implementation of NASBench
Stars: ✭ 43 (-69.06%)
Mutual labels:  neural-architecture-search
Representation-Learning-for-Information-Extraction
Pytorch implementation of Paper by Google Research - Representation Learning for Information Extraction from Form-like Documents.
Stars: ✭ 82 (-41.01%)
Mutual labels:  pytorch-implementation
pyrff
pyrff: Python implementation of random fourier feature approximations for gaussian processes
Stars: ✭ 24 (-82.73%)
Mutual labels:  thompson-sampling
rlberry
An easy-to-use reinforcement learning library for research and education.
Stars: ✭ 124 (-10.79%)
Mutual labels:  reinforcement-learning-algorithms
Reinforcement-Learning-on-google-colab
Reinforcement Learning algorithm's using google-colab
Stars: ✭ 33 (-76.26%)
Mutual labels:  reinforcement-learning-algorithms
CheXpert-Challenge
Code for CheXpert Challenge 2019 Top 1 && Top 2 solution
Stars: ✭ 30 (-78.42%)
Mutual labels:  pytorch-implementation
Hypernets
A General Automated Machine Learning framework to simplify the development of End-to-end AutoML toolkits in specific domains.
Stars: ✭ 221 (+58.99%)
Mutual labels:  neural-architecture-search
spm-image
Sparse modeling and Compressive sensing in Python
Stars: ✭ 93 (-33.09%)
Mutual labels:  machine-learning-library
cycleGAN-PyTorch
A clean and lucid implementation of cycleGAN using PyTorch
Stars: ✭ 107 (-23.02%)
Mutual labels:  pytorch-implementation
Awesome-Rust-MachineLearning
This repository is a list of machine learning libraries written in Rust. It's a compilation of GitHub repositories, blogs, books, movies, discussions, papers, etc. 🦀
Stars: ✭ 1,110 (+698.56%)
Mutual labels:  machine-learning-library
Auto-Compression
Automatic DNN compression tool with various model compression and neural architecture search techniques
Stars: ✭ 19 (-86.33%)
Mutual labels:  neural-architecture-search
MetaD2A
Official PyTorch implementation of "Rapid Neural Architecture Search by Learning to Generate Graphs from Datasets" (ICLR 2021)
Stars: ✭ 49 (-64.75%)
Mutual labels:  neural-architecture-search
yarll
Combining deep learning and reinforcement learning.
Stars: ✭ 84 (-39.57%)
Mutual labels:  reinforcement-learning-algorithms
NGCF-PyTorch
PyTorch Implementation for Neural Graph Collaborative Filtering
Stars: ✭ 200 (+43.88%)
Mutual labels:  pytorch-implementation
awesome-transformer-search
A curated list of awesome resources combining Transformers with Neural Architecture Search
Stars: ✭ 194 (+39.57%)
Mutual labels:  neural-architecture-search
3D-UNet-PyTorch-Implementation
The implementation of 3D-UNet using PyTorch
Stars: ✭ 78 (-43.88%)
Mutual labels:  pytorch-implementation
svae cf
[ WSDM '19 ] Sequential Variational Autoencoders for Collaborative Filtering
Stars: ✭ 38 (-72.66%)
Mutual labels:  pytorch-implementation
UAV-DDPG
Code for paper "Computation Offloading Optimization for UAV-assisted Mobile Edge Computing: A Deep Deterministic Policy Gradient Approach"
Stars: ✭ 133 (-4.32%)
Mutual labels:  reinforcement-learning-algorithms
MolDQN-pytorch
A PyTorch Implementation of "Optimization of Molecules via Deep Reinforcement Learning".
Stars: ✭ 58 (-58.27%)
Mutual labels:  pytorch-implementation

Online Neural Network (ONN)

This is a Pytorch implementation of the Online Deep Learning: Learning Deep Neural Networks on the Fly paper. This algorithm contains a new backpropagation approach called Hedge Backpropagation and it is useful for online learning. In this algorithm you model a overnetwork architeture and the algorithm will try to turn on or turn off some of the hidden layers automatically. This algorithm uses the first hidden layer to train/predict but if it is going bad it starts to use another layers automatically. For more informations read the paper in the 'References' section.

Installing

pip install onn

How to use

#Importing Library
import numpy as np
from onn.OnlineNeuralNetwork import ONN

#Starting a neural network with feature size of 2, hidden layers expansible until 5, number of neuron per hidden layer = 10 #and two classes.
onn_network = ONN(features_size=2, max_num_hidden_layers=5, qtd_neuron_per_hidden_layer=10, n_classes=2)

#Do a partial training
onn_network.partial_fit(np.asarray([[0.1, 0.2]]), np.asarray([0]))
onn_network.partial_fit(np.asarray([[0.8, 0.5]]), np.asarray([1]))

#Predict classes
predictions = onn_network.predict(np.asarray([[0.1, 0.2], [0.8, 0.5]]))

Predictions -- array([1, 0])

New features

  • The algortihm works with batch now. (It is not recommended because this is an online approach. It is useful for experimentation.)
  • The algorithm can use CUDA if available. (If the network is very small, it is not recommended. The CPU will process more fast.)

Non-linear Contextual Bandit Algorithm (ONN_THS)

The ONN_THS acts like a non-linear contextual bandit (a reinforcement learning algorithm). This algorithm works with the non-linear exploitation factor (ONN) plus an exploration factor provided by Thompson Sampling algorithm. The ONN_THS works with 'select' and 'reward' actions. For more detailed examples, please look at the jupyter notebook file in this repository. This algorithm was created by me to solve a problem in the company I work.

The great thing about this algorithm is that it can be used in an online manner and it has a non-linear exploitation. This algorithm can learn different kind of data in a reinforcement learning way.

How to use

#Importing Library
import numpy as np
from onn.OnlineNeuralNetwork import ONN_THS

#Starting a neural network with feature size of 2, hidden layers expansible until 5, number of neuron per hidden layer = 10 #and two classes.
onn_network = ONN_THS(features_size=2, max_num_hidden_layers=5, qtd_neuron_per_hidden_layer=10, n_classes=2)

#Select an action
arm_selected, exploration_factor = onn_network.predict(np.asarray([[0.1, 0.2]]))

#Reward an action
onn_network.partial_fit(np.asarray([[0.1, 0.2]]), np.asarray([arm_selected]), exploration_factor)

Contributors

References

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].