Skip to content

Instantly share code, notes, and snippets.

View trvslhlt's full-sized avatar

travis holt trvslhlt

View GitHub Profile
@trvslhlt
trvslhlt / clause_and_effect.ipynb
Last active May 9, 2026 22:11
clause_and_effect
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

MNIST from scratch

This notebook walks through an example of training a TensorFlow model to do digit classification using the MNIST data set. MNIST is a labeled set of images of handwritten digits.

An example follows.

from __future__ import print_function
@trvslhlt
trvslhlt / gist:ba3e9baa2fdc43a999b7
Created December 6, 2015 19:06
Ulam's Spiral Swift
import UIKit
import XCPlayground
func isPrime(number: Int) -> Bool {
if number < 2 { return false }
let squareRoot = Int(sqrt(Double(number)))
if squareRoot * squareRoot == number { return false }
for i in 2..<Int(ceil(sqrt(Double(number)))) {
if number % i == 0 { return false }
}