Skip to content

Instantly share code, notes, and snippets.

View gnperdue's full-sized avatar
👋

Gabriel Perdue gnperdue

👋
View GitHub Profile
@grosch
grosch / IntegerTextField.swift
Created December 21, 2020 11:23
SwiftUI TextField which only accepts integers and binds to an Int? instead of a String
import SwiftUI
private class IntegerTextFieldValue: ObservableObject {
@Published var value = "" {
didSet {
let numbersOnly = value.filter { $0.isNumber }
if value != numbersOnly {
value = numbersOnly
}
}
@tokestermw
tokestermw / restore_tf_models.py
Created February 21, 2017 21:09
Restoring frozen models are hard in TensorFlow.
"""
Play with saving .
Closest:
https://github.com/tensorflow/tensorflow/issues/616#issuecomment-205620223
"""
import numpy as np
import tensorflow as tf
from tensorflow.python.platform import gfile
@teamdandelion
teamdandelion / labels_1024.tsv
Last active February 6, 2024 08:33
TensorBoard: TF Dev Summit Tutorial
We can make this file beautiful and searchable if this error is corrected: No tabs found in this TSV file in line 0.
7
2
1
0
4
1
4
9
5
9
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kaushikpavani
kaushikpavani / compute_caffe_parameters.py
Created September 25, 2016 14:14
Calculate number of parameters in a Caffe model
import caffe
caffe.set_mode_cpu()
import numpy as np
from numpy import prod, sum
from pprint import pprint
def print_net_parameters (deploy_file):
print "Net: " + deploy_file
net = caffe.Net(deploy_file, caffe.TEST)
print "Layer-wise parameters: "
@tomokishii
tomokishii / mnist_cnn_bn.py
Last active December 14, 2023 03:55
MNIST using Batch Normalization - TensorFlow tutorial
#
# mnist_cnn_bn.py date. 5/21/2016
# date. 6/2/2017 check TF 1.1 compatibility
#
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.
@staltz
staltz / introrx.md
Last active July 19, 2024 22:21
The introduction to Reactive Programming you've been missing
@jakevdp
jakevdp / README.md
Last active February 11, 2024 00:16
D3/IPython widget example

D3 IPython Widget Example

A simple example of two-way communication between IPython notebook and javascript, using a D3 widget.

View this notebook on nbviewer, but be aware that it won't work without being connected to an IPython kernel!

It's better to download the notebook itself and open it with IPython notebook.

@bitemyapp
bitemyapp / gist:8739525
Last active May 7, 2021 23:22
Learning Haskell