All Projects → cesarsouza → Keras Sharp

cesarsouza / Keras Sharp

Licence: other
Keras# initiated as an effort to port the Keras deep learning library to C#, supporting both TensorFlow and CNTK

Projects that are alternatives of or similar to Keras Sharp

Pixel level land classification
Tutorial demonstrating how to create a semantic segmentation (pixel-level classification) model to predict land cover from aerial imagery. This model can be used to identify newly developed or flooded land. Uses ground-truth labels and processed NAIP imagery provided by the Chesapeake Conservancy.
Stars: ✭ 217 (-12.15%)
Mutual labels:  neural-networks
Neural Network From Scratch
Ever wondered how to code your Neural Network using NumPy, with no frameworks involved?
Stars: ✭ 230 (-6.88%)
Mutual labels:  neural-networks
Ntm One Shot Tf
One Shot Learning using Memory-Augmented Neural Networks (MANN) based on Neural Turing Machine architecture in Tensorflow
Stars: ✭ 238 (-3.64%)
Mutual labels:  neural-networks
Dilated Cnn Ner
Dilated CNNs for NER in TensorFlow
Stars: ✭ 222 (-10.12%)
Mutual labels:  neural-networks
Mydatascienceportfolio
Applying Data Science and Machine Learning to Solve Real World Business Problems
Stars: ✭ 227 (-8.1%)
Mutual labels:  neural-networks
Nn
🧑‍🏫 50! Implementations/tutorials of deep learning papers with side-by-side notes 📝; including transformers (original, xl, switch, feedback, vit, ...), optimizers (adam, adabelief, ...), gans(cyclegan, stylegan2, ...), 🎮 reinforcement learning (ppo, dqn), capsnet, distillation, ... 🧠
Stars: ✭ 5,720 (+2215.79%)
Mutual labels:  neural-networks
Neuralnetworksanddeeplearning.com.pdf
LaTeX/PDF + Epub version of the online book (http://neuralnetworksanddeeplearning.com) ”Neural Networks and Deep Learning“ by Michael Nielsen (@mnielsen)
Stars: ✭ 216 (-12.55%)
Mutual labels:  neural-networks
Kerasdeepspeech
A Keras CTC implementation of Baidu's DeepSpeech for model experimentation
Stars: ✭ 245 (-0.81%)
Mutual labels:  neural-networks
Color Accessibility Neural Network Deeplearnjs
🍃 Using a Neural Network to improve web accessibility in JavaScript.
Stars: ✭ 230 (-6.88%)
Mutual labels:  neural-networks
Inferno
A utility library around PyTorch
Stars: ✭ 237 (-4.05%)
Mutual labels:  neural-networks
Machine Learning Notebooks
Machine Learning notebooks for refreshing concepts.
Stars: ✭ 222 (-10.12%)
Mutual labels:  neural-networks
Gam
A PyTorch implementation of "Graph Classification Using Structural Attention" (KDD 2018).
Stars: ✭ 227 (-8.1%)
Mutual labels:  neural-networks
Stock Price Prediction Lstm
OHLC Average Prediction of Apple Inc. Using LSTM Recurrent Neural Network
Stars: ✭ 232 (-6.07%)
Mutual labels:  neural-networks
Keras Gp
Keras + Gaussian Processes: Learning scalable deep and recurrent kernels.
Stars: ✭ 218 (-11.74%)
Mutual labels:  neural-networks
Igel
a delightful machine learning tool that allows you to train, test, and use models without writing code
Stars: ✭ 2,956 (+1096.76%)
Mutual labels:  neural-networks
Tcdf
Temporal Causal Discovery Framework (PyTorch): discovering causal relationships between time series
Stars: ✭ 217 (-12.15%)
Mutual labels:  neural-networks
Echotorch
A Python toolkit for Reservoir Computing and Echo State Network experimentation based on pyTorch. EchoTorch is the only Python module available to easily create Deep Reservoir Computing models.
Stars: ✭ 231 (-6.48%)
Mutual labels:  neural-networks
Speechbrain.github.io
The SpeechBrain project aims to build a novel speech toolkit fully based on PyTorch. With SpeechBrain users can easily create speech processing systems, ranging from speech recognition (both HMM/DNN and end-to-end), speaker recognition, speech enhancement, speech separation, multi-microphone speech processing, and many others.
Stars: ✭ 242 (-2.02%)
Mutual labels:  neural-networks
Da Rnn
Dual-Stage Attention-Based Recurrent Neural Net for Time Series Prediction
Stars: ✭ 242 (-2.02%)
Mutual labels:  neural-networks
Deepposekit
a toolkit for pose estimation using deep learning
Stars: ✭ 233 (-5.67%)
Mutual labels:  neural-networks

Keras Sharp

Note: This project is about to get archived. For a better replacement, please take a look at TensorFlow.NET or Keras.NET.

Cheers and happy coding!
Cesar


Join the chat at https://gitter.im/keras-sharp/Lobby An ongoing effort to port most of the Keras deep learning library to C#.

Welcome to the Keras# project! We aim to bring a experience-compatible Keras-like API to C#, meaning that, if you already know Keras, you should not have to learn any new concepts to get up and running with Keras#. This is a direct, line-by-line port of the Keras project, meaning that all updates and fixes currently sent to the main Keras project should be simple and straightforward to be applied to this branch. As in the original project, we aim to support both TensorFlow and CNTK - but not Theano, as it has been recently discontinued in 2017.

Example

Consider the following Keras Python example originally done by Jason Brownlee, reproduced below:

from keras.models import Sequential
from keras.layers import Dense
import numpy

# fix random seed for reproducibility
numpy.random.seed(7)

# load pima indians dataset
dataset = numpy.loadtxt("pima-indians-diabetes.csv", delimiter=",")
# split into input (X) and output (Y) variables
X = dataset[:,0:8]
Y = dataset[:,8]

# create model
model = Sequential()
model.add(Dense(12, input_dim=8, activation='relu'))
model.add(Dense(8, activation='relu'))
model.add(Dense(1, activation='sigmoid'))

# Compile model
model.compile(loss='binary_crossentropy', optimizer='adam', metrics=['accuracy'])

# Fit the model
model.fit(X, Y, epochs=150, batch_size=10)

# evaluate the model
scores = model.evaluate(X, Y)
print("\n%s: %.2f%%" % (model.metrics_names[1], scores[1]*100))

The same can be obtained using Keras# using:

// Load the Pima Indians Data Set
var pima = new Accord.DataSets.PimaIndiansDiabetes();
float[,] x = pima.Instances.ToMatrix().ToSingle();
float[] y = pima.ClassLabels.ToSingle();

// Create the model
var model = new Sequential();
model.Add(new Dense(12, input_dim: 8, activation: new ReLU()));
model.Add(new Dense(8, activation: new ReLU()));
model.Add(new Dense(1, activation: new Sigmoid()));

// Compile the model (for the moment, only the mean square 
// error loss is supported, but this should be solved soon)
model.Compile(loss: new MeanSquareError(), 
    optimizer: new Adam(), 
    metrics: new[] { new Accuracy() });

// Fit the model for 150 epochs
model.fit(x, y, epochs: 150, batch_size: 10);

// Use the model to make predictions
float[] pred = model.predict(x)[0].To<float[]>();

// Evaluate the model
double[] scores = model.evaluate(x, y);
Console.WriteLine($"{model.metrics_names[1]}: {scores[1] * 100}");

Upon execution, you should see the same familiar Keras behavior as shown below:

Keras Sharp during training

This is posssible because Keras# is a direct, line-by-line port of the Keras project into C#. A goal of this project is to make sure that porting existing code from its Python counterpart into C# can be done in no time or with minimum effort, if at all.

Backends

Keras# currently supports TensorFlow and CNTK backends. If you would like to switch between different backends:

KerasSharp.Backends.Current.Switch("KerasSharp.Backends.TensorFlowBackend");

or,

KerasSharp.Backends.Current.Switch("KerasSharp.Backends.CNTKBackend");

or,

If you would like to implement your own backend to your own preferred library, such as DiffSharp, just provide your own implementation of the IBackend interface and specify it using:

KerasSharp.Backends.Current.Switch("YourNamespace.YourOwnBackend");

Work-in-progress

However, please note that this is still work-in-progress. Not only Keras#, but also TensorFlowSharp and CNTK. If you would like to contribute to the development of this project, please consider submitting new issues to any of those projects, including us.

Contributing in development

If you would like to contribute to the project, please see: How to contribute to Keras#.

License & Copyright

The Keras-Sharp project is brought to you under the as-permissable-as-possible MIT license. This is the same license provided by the original Keras project. This project also keeps track of all code contributions through the project's issue tracker, and pledges to update all licensing information once user contributions are accepted. Contributors are asked to grant explicit copyright licensens upon their contributions, which guarantees this project can be used in production without any licensing-related worries.

This project is brought to you by the same creators of the Accord.NET Framework.

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].