Skip to content

Instantly share code, notes, and snippets.

View machinelearning147's full-sized avatar
🎯
Focusing

Machine Learning AI machinelearning147

🎯
Focusing
View GitHub Profile
@asimjalis
asimjalis / python-zip.md
Created December 7, 2012 23:33
How to deploy a Python application as a zip file

How to deploy a Python application as a zip file

by Asim Jalis, MetaProse.com

Create a file __main__.py containing:

print "Hello world from Python"

Zip up the Python files (in this case just this one file) into app.zip by typing:

@karpathy
karpathy / min-char-rnn.py
Last active November 19, 2024 10:40
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)
@bamos
bamos / openface-data-example
Created January 26, 2016 15:50
OpenFace Data Example
$ tree data/mydataset/raw
person-1
├── image-1.jpg
├── image-2.png
...
└── image-p.png
...
person-m
@swyoon
swyoon / np_to_tfrecords.py
Last active September 11, 2024 08:28
From numpy ndarray to tfrecords
import numpy as np
import tensorflow as tf
__author__ = "Sangwoong Yoon"
def np_to_tfrecords(X, Y, file_path_prefix, verbose=True):
"""
Converts a Numpy array (or two Numpy arrays) into a tfrecord file.
For supervised learning, feed training inputs to X and training labels to Y.
For unsupervised learning, only feed training inputs to X, and feed None to Y.
@gangliao
gangliao / tf_data_hdfs.py
Last active March 6, 2020 09:06
Using Tensorflow's tf.data to load data from HDFS
import tensorflow as tf
filenames = ["hdfs://10.152.104.73:8020/sogou/train_data/1_final.feature_transform"]
dataset = tf.data.TextLineDataset(filenames)
iterator = dataset.make_one_shot_iterator()
next_batch = iterator.get_next()
@shravankumar147
shravankumar147 / mnist_estimator.py
Created July 3, 2018 18:38 — forked from peterroelants/mnist_estimator.py
Example using TensorFlow Estimator, Experiment & Dataset on MNIST data.
"""Script to illustrate usage of tf.estimator.Estimator in TF v1.3"""
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data as mnist_data
from tensorflow.contrib import slim
from tensorflow.contrib.learn import ModeKeys
from tensorflow.contrib.learn import learn_runner
# Show debugging output