Giter VIP home page Giter VIP logo

deep-learning-with-csharp-and-cntk's Introduction

Deep Learning with C# and CNTK

In this repository we use C# with CNTK to implement various deep learning papers, as well as a port of the Keras examples in the book Deep Learning with Python.

The folder Papers contains the Visual Studio 2017 solution with the paper implementations.

The folder DeepLearning contains the Visual Studio 2015 solution for the book examples.

The requirements are Windows 10, and a relatively modern NVIDIA graphics card. All training examples should run even without a graphics card, but... very slow.

Papers

Capsules implements the paper "Dynamic Routing Between Capsules"
by Sara Sabour, Nicholas Frosst, and Geoffrey E Hinton. (https://arxiv.org/abs/1710.09829)

Port of Deep Learning With Python

Keras is a very popular Python Deep Learning library.

Recently, the creator of Keras, Francois Chollet, published the excellent book Deep Learning with Python.

The following projects are a C# port of https://github.com/fchollet/deep-learning-with-python-notebooks using CNTK as backend.

Ch_02_First_Look_At_A_Neural_Network introduces softmax and fully connected layers. MNIST data set.

Ch_03_Classifying_Movie_Reviews introduces binary cross-entropy. IMDB data set.

Ch_03_Predicting_House_Prices introduces MSE and KFold training on a regression problem. Housing Prices dataset.

Ch_04_Overfitting_and_Underfitting introduces Regularization and Dropout. Housing Prices dataset.

Ch_05_Introduction_to_Convnets introduces Conv2D filters. MNIST data set.

Ch_05_Using_Convnets_With_Small_Datasets introduces on-the-fly data augmentation. Cats And Dogs dataset.

Ch_05_Using_A_Pretrained_Convnet uses the VGG16 "bottleneck" features, with optional augmentation, and fine-tuning.

Ch_05_Visualizing_Intermediate_Activations displays the feature maps that are output by various layers.

Ch_05_Visualizing_Convnet_Filters finds the visual pattern that each filter responds to using gradient ascent in input space.

Ch_05_Class_Activation_Heatmaps show which part of an image a convnet focused on.

Ch_06_One_Hot_Encoding discusses one-hot encoding of words.

Ch_06_Using_Word_Embeddings introduces the Embedding layer, and pre-trained word embeddings (GloVe).

Ch_06_Understanding_Recurrent_Neural_Networks introduces LSTMs.

Ch_06_Advanced_Usage_Of_Recurrent_Neural_Networks does temperature forecasting with (stacked) GRUs.

Ch_06_Sequence_Processing_With_Convnets introduces Conv1D filters.

Ch_08_Text_Generation_With_LSTM implements character-level LSTM text generation.

Ch_08_Deep_Dream shows how neural networks hallucinate.

Ch_08_Neural_Style_Transfer applies the style of an image to another.

Ch_08_Generating_Images_With_VAEs introduces Variational Autoencoders. MNIST dataset.

Ch_08_Introduction_to_GANs creates images of fake frogs using a Generative Adversarial Network.

Running the examples on Windows 10

The folder DeepLearning contains the Visual Studio 2015 solution.

No need to install CNTK, as it will be installed automatically by NuGet.

If you have an NVIDIA graphics card, you will need to have CUDA + cuDNN installed.

The project is self-contained. No need to install anything else.

Note that apart from CNTK, the following NuGet packages are used:

Python Code

If you would like to experiment with the original Python code, the folder Python contains the python code, as extracted from the notebooks.

To run the Python code on Windows 10, just get anaconda3, install Keras (with pip install keras), and also install CNKT, if you would like to use CNTK as Keras backend.

For each Python script in the Python folder, there is a corresponding C# project, with a README.md file that explains how the port was made.

deep-learning-with-csharp-and-cntk's People

Contributors

anastasios-stamoulis 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  avatar

deep-learning-with-csharp-and-cntk's Issues

Neural Transfer Troubles

I'm very interested in sorting this out but it may be beyond either of us. When I try to implement your Neural Style Transfer exercise with my solution (which uses CNTK 2.6 ) I come up stuck against this error:

"Input('combinationImage', [206 x 216 x 3], [, #]) -> Output('conv5_2', [13 x 14 x 512], [, #]), Output('conv1_1', [206 x 216 x 64], [, #]), Output('conv2_1', [103 x 108 x 128], [, #]), Output('conv3_1', [52 x 54 x 256], [, #]), Output('conv4_1', [26 x 27 x 512], [, #]), Output('conv5_1', [13 x 14 x 512], [*, #])' with more than one output cannot be implicitly converted to a Variable"

Does this error come when you switch to version 2.6 (or even 2.5.1)?

LSTM Example with non binary data

How would you implement the LSTM example with non binary data. I was wondering if you could provide a quick explanation or example?

DLL 'Cntk.Core.CSBinding-2.3.1.dll'

I get this error
DllNotFoundException: Unable to load DLL 'Cntk.Core.CSBinding-2.3.1.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
Can you help?
Thanks,
Stefano
PS: Windows 10
Visual Studio Comunity 2017

Unfound Directories

Great work, really helpful!

I caught one error in the with Using Pre-trained _Convnet Models - "'Cannot open file 'D:\kaggle_cats_dogs\cat.582.jpg"

The same error is thrown with "...Convnets with Small Datasets"

Issue in Ch_03_Classifying_Movie_Reviews ?

Hi
Thank for this great job ! very interesting.
I'm wondering if in evaluation phase with evaluation_phase() , the tensor to use is more x_test than x_train ?

Best regards
Thierry

Get Prediction

Hi, I'm Trying to get prediction of the model I have. for example in ch2 first look at a neural network.
but there is no function I can find to do so using cntk.Can you help me with that?

Directory Not found with Word Embedding

Try to run this but found this little problem:

"Error with "Ch_06_Using_Word_Embeddings"

System.IO.DirectoryNotFoundException: 'Could not find a part of the path 'C:\Users\anastasios\Downloads\aclImdb\train\neg'.'"

example for CRNN

Hi,
It's great work you made.
recently I'm studying your code, I wanna trying CRNN network using CNTK && C#,
finally I failed, I'm not clear how to feed CNN's output into LSTM.
would you like make one example about this ?
thanks!

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.