- These are the models studied, implemented and tested by me in the past;
- I used lightweight datasets, so even if you don't have GPU, you can still run these scripts;
- If you would like to support, please Star the project, many thanks!
Guide
- The following command clones all the files (>300MB);
git clone https://github.com/zhedongzheng/finch.git
- Use contents to find the model and test that may interest you, click on that test
- Find the test file path
- run on command line
cd finch/nlp-models/tensorflow
python rnn_attn_estimator_imdb_test.py
Library
Py3 is perferred, but Py2 should also work in theory (if it doesn't please raise an issue)
Style
Model
is implemented very early, usingfeed_dict
(most common but slowest data pipeline);- I am moving towards
Estimator
, which is based on tf.estimator.Estimator, more efficient;
Contents
NLP
Text Representation
-
Python | LSA | Model for Visualization Test Result | Model for Concepts Test Result |
Text Classification
-
TensorFlow | CNN Model IMDB Test | Model (Multi-kernel) IMDB Test Result |
-
TensorFlow | LSTM + Attention Model IMDB Test | Estimator IMDB Test IMDB Config |
Text Generation
-
Python | 2nd order Markov Model Robert Frost Test |
-
TensorFlow | Char-RNN Model | English Test Chinese Test | Model (Beam-Search) English Test |
-
TensorFlow | Varational Recurrent Autoencoder |
Text Labelling
-
TensorFlow | LSTM Model | POS Tagging Test | Chinese Segmentation Test |
-
TensorFlow | BiLSTM Model | POS Tagging Test | Chinese Segmentation Test |
-
TensorFlow | BiLSTM + CRF Model | POS Tagging Test | Chinese Segmentation Test |
Text to Text
-
TensorFlow | Seq2Seq Model Sorting Test | Estimator Sorting Test |
-
TensorFlow | Seq2Seq + Attention Model Sorting Test |
-
TensorFlow | Seq2Seq + BiLSTM Encoder Model Sorting Test |
-
TensorFlow | Seq2Seq + Beam-Search Model Sorting Test |
-
TensorFlow | Seq2Seq + BiLSTM Encoder + Attention + Beam-Search Model Sorting Test |
-
-
TensorFlow | Attention Is All You Need - Transformer |
Image To Text
(To run this section, you need to download COCO dataset first)
Computer Vision
Image Classification
-
Python | Bayesian Inference Pixel Classification |
-
TensorFlow | MLP Model MNIST Test CIFAR10 Test |
-
TensorFlow | CNN Model MNIST Test CIFAR10 Test | Estimator MNIST Test |
-
TensorFlow | RNN Model MNIST Test CIFAR10 Test | Estimator MNIST Test |
Image Generation
-
Autoencoder
-
TensorFlow | Stacked Autoencoder (weights-tied) Model MNIST Test |
-
TensorFlow | Denoising Autoencoder Model MNIST Test |
-
TensorFlow | Sparse Autoencoder Model MNIST Test |
-
TensorFlow | Variational Autoencoder Model MNIST Test |
-
TensorFlow | Conv2D Autoencoder (weights-tied) Model MNIST Test CIFAR10 Test |
-
-
Generative Adversarial Network
- TensorFlow | DCGAN Model MNIST Test Result | Conditional Model MNIST Test |
OpenCV
-
OP | Resize
-
OP | Rotations
-
Segmentation | Contours
-
Segmentation | Sorting Contours
-
Segmentation | Line detection
-
Segmentation | Circle detection
-
Segmentation | Blob detection
-
Detection | Face & Eye Detection Using Cascade Classifier
-
Detection | Walker & Car Detection Using Cascade Classifier
Information Retrieval
-
Python | Apriori Model MovieLens Test |
-
Python | Collborative Filtering | MovieLens User-based Model Test |
-
TensorFlow | Matrix Factorization Model MovieLens Test |
Reinforcement Learning
-
Python | Q-Learning Model CartPole Test |
-
Python | Sarsa Model CartPole Test |
-
TensorFlow | Policy Gradient Model CartPole Test |
Appendix
Shallow Structure Models
-
TensorFlow | K Nearest Neighbors Model MNIST Test |
-
TensorFlow | K-Means Model MNIST Test |
Ensemble
-
Python | Adaboost Pseudocode Model Test |
-
TensorFlow | Random Forest Estimator & MNIST Test |
-
TensorFlow | Gradient Boosting Trees Estimator & MNIST Test |