https://gist.github.com/victor-shepardson/5b3d3087dc2b4817b9bffdb8e87a57c4
I'm using Ubuntu 16.04 with a GTX 1060
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. |
https://gist.github.com/victor-shepardson/5b3d3087dc2b4817b9bffdb8e87a57c4
I'm using Ubuntu 16.04 with a GTX 1060
from contextlib import contextmanager | |
import numpy as np | |
import torch | |
from torch import Tensor, ByteTensor | |
import torch.nn.functional as F | |
from torch.autograd import Variable | |
import pycuda.driver | |
from pycuda.gl import graphics_map_flags | |
from glumpy import app, gloo, gl |
In this short article, I show you how to create nice scientific presentations using a combination of Inkscape and LaTex, made possible by two small tools I wrote.
""" | |
Run the algorithm below using CPython, Cython, PyPy and Numba and compare | |
their performance. (This is implementing a spigot algorithm by A. Sale, | |
D. Saada, S. Rabinowitz, mentioned on | |
http://mail.python.org/pipermail/edu-sig/2012-December/010721.html). | |
""" | |
def pi_digits(n): | |
"Generate n digits of Pi." | |
k, a, b, a1, b1 = 2, 4, 1, 12, 4 |