Skip to content

Instantly share code, notes, and snippets.

View jimfleming's full-sized avatar

Jim Fleming jimfleming

View GitHub Profile
@jimfleming
jimfleming / randint.py
Created April 17, 2017 03:23
Return random integers from low (inclusive) to high (exclusive). Interface borrowed from numpy.random.randint.
def randint(low, high=None, size=None, dtype=tf.int32):
"""
Return random integers from low (inclusive) to high (exclusive).
Interface borrowed from numpy.random.randint.
"""
if high is None:
high = low
low = 0
assert dtype.is_integer(), 'dtype for randint must be an integer'
return tf.random_uniform(shape=size, minval=low, maxval=high, dtype=dtype)
@jimfleming
jimfleming / colorize.py
Last active November 25, 2022 19:36
A utility function for TensorFlow that maps a grayscale image to a matplotlib colormap for use with TensorBoard image summaries.
import matplotlib
import matplotlib.cm
import tensorflow as tf
def colorize(value, vmin=None, vmax=None, cmap=None):
"""
A utility function for TensorFlow that maps a grayscale image to a matplotlib
colormap for use with TensorBoard image summaries.
@jimfleming
jimfleming / Ornstein-Uhlenbeck.ipynb
Last active December 7, 2020 16:09
Summary of the Ornstein–Uhlenbeck process.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Keybase proof

I hereby claim:

  • I am jimfleming on github.
  • I am jimfleming (https://keybase.io/jimfleming) on keybase.
  • I have a public key whose fingerprint is A2C3 A14C 518F 9625 C898 5747 53FC 930D 4B45 E90F

To claim this, I am signing this object:

@jimfleming
jimfleming / test.py
Last active May 26, 2016 18:40
Minimal example of missing placeholder bug.
import numpy as np
from keras.models import Model
from keras.layers import Input, Dense, RepeatVector, Activation, Flatten, Reshape
from keras.layers.convolutional import Convolution2D, MaxPooling2D, AveragePooling2D, UpSampling2D
from keras.layers.normalization import BatchNormalization
from keras.layers.recurrent import LSTM
from keras.layers.wrappers import TimeDistributed
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
{
"name": "Panda3D Reference",
"package": "pandaref",
"index": "index.html",
"selectors": {
".header .headertitle .title": "Class",
".memitem .memproto .memname a": "Method"
},
"ignore": [],
"icon32x32": "",
{
"name": "Panda3D Manual",
"package": "pandaman",
"index": "Main_Page.html",
"selectors": {
"ol.toc li a": "Guide"
},
"ignore": [
],
struct Graph<'a> {
neurons: HashMap<u64, &'a (Node + 'a)>,
}
@jimfleming
jimfleming / Blur.cs
Last active April 8, 2024 18:09
A simple class to perform image blurring by overriding the main RenderTexture.
using UnityEngine;
using UnityEditor;
using System;
using System.IO;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using System.Text.RegularExpressions;
public class Blur {