<commit_before># Cat Classifier

I think deep learning is accessible enough now that if you know how to program,
you know how to get started using it for your own tasks. This great
[article](https://medium.com/@ageitgey/machine-learning-is-fun-part-3-deep-learning-and-convolutional-neural-networks-f40359318721#.469g9yw20)
shows you how you can use `tflearn`, a [TensorFlow](https://www.tensorflow.org/)
based Python library to create predictive models based on the CIFAR-10 dataset.

This is a simple implementation using the same neural network layout to identify
labeled photos of my cat.<commit_msg>Clarify running instructions<commit_after># Cat Classifier

I think deep learning is accessible enough now that if you know how to program,
you know how to get started using it for your own tasks. This great
[article](https://medium.com/@ageitgey/machine-learning-is-fun-part-3-deep-learning-and-convolutional-neural-networks-f40359318721#.469g9yw20)
shows you how you can use `tflearn`, a [TensorFlow](https://www.tensorflow.org/)
based Python library to create predictive models based on the CIFAR-10 dataset.

This is a simple implementation using the same neural network layout to identify
labeled photos of my cat.

## Run

To run this, first create an Anaconda environment based off the
`environment.yml` using Python 3.5. Then, create a folder `images` in the local
directory with two subfolders `cat` and `not_cat`. Sort through your own files
and copy your cat photos into `cat` and your non-cat photos into `not_cat`.

To run the training step, run:

    python cnn.py

which will read all of the files and train a network based on the image
features. That script will also write to a file `cat-classifier.tfl` which is a
binary representation of the trained model that you can use in later scripts.

To use a trained model from `cnn.py` to classify your own images, run:

    python classify.py <image_path>

where `<image_path>` is the path of an image you want to classify. The output
from this is a JSON object with probabilities for `cat` and `not_cat` scores.
{'fraction_non_alphanumeric': 0.06878306878306878, 'fraction_numerical': 0.020202020202020204, 'mean_word_length': 4.531914893617022, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5639064', 'n_tokens_mistral': 613, 'n_tokens_neox': 575, 'n_words': 286}