Skip to content

Instantly share code, notes, and snippets.

View zunction's full-sized avatar

Zhangsheng Lai zunction

View GitHub Profile
@zunction
zunction / how-to-use-pelican.md
Created January 19, 2016 05:32 — forked from JosefJezek/how-to-use-pelican.md
How to use Pelican on GitHub Pages
@zunction
zunction / compare_adagrad_adadelta.py
Created January 11, 2017 05:50 — forked from xiaohan2012/compare_adagrad_adadelta.py
Comparing adagrad, adadelta in gradient descent in Theano
"""
Comparing adagrad, adadelta and constant learning in gradient descent(the seddle point function y^2 - x^2)
Reference:
1. comparison on several learning rate update scheme: http://ml.memect.com/archive/2014-12-12/short.html#3786866375172817
2. Saddle point, http://en.wikipedia.org/wiki/Saddle_point
"""
import numpy as np
import theano
@zunction
zunction / pythonstuff.md
Created June 25, 2017 04:23
some python stuff to refer to if I forget

How to run python on git bash (portable)

  1. In git bash cd ~ followed by vim .bashrc.
  2. Add alias python='winpty python.exe.
  3. Restart the shell to apply the change.
@zunction
zunction / pycuda.md
Last active January 14, 2022 12:15
pycuda stuff
import pycuda
import pycuda.driver as cuda
from pycuda.compiler import SourceModule
import threading
import numpy as np

Global memory

@zunction
zunction / TDA_resources.md
Created February 23, 2018 17:43 — forked from calstad/TDA_resources.md
List of resources for TDA

Quick List of Resources for Topological Data Analysis with Emphasis on Machine Learning

This is just a quick list of resourses on TDA that I put together for @rickasaurus after he was asking for links to papers, books, etc on Twitter and is by no means an exhaustive list.

Survey Papers

Both Carlsson's and Ghrist's survey papers offer a very good introduction to the subject

Other Papers and Web Resources

@zunction
zunction / draw_neural_net.py
Created July 27, 2018 06:05 — forked from craffel/draw_neural_net.py
Draw a neural network diagram with matplotlib!
import matplotlib.pyplot as plt
def draw_neural_net(ax, left, right, bottom, top, layer_sizes):
'''
Draw a neural network cartoon using matplotilb.
:usage:
>>> fig = plt.figure(figsize=(12, 12))
>>> draw_neural_net(fig.gca(), .1, .9, .1, .9, [4, 7, 2])
@zunction
zunction / fast_fin.v
Created May 24, 2019 11:31 — forked from JasonGross/fast_fin.v
Fast boolean equality proofs on finite types
Require Import Coq.Lists.List.
Require Import Coq.Bool.Bool.
Import ListNotations.
Lemma negb_existsb_nth_error {A} (ls : list A) (f : A -> bool) (H : existsb f ls = false) n v (H' : nth_error ls n = Some v)
: f v = false.
Proof.
revert dependent n; induction ls, n; cbn in *; intros; try congruence.
all: repeat first [ progress subst
| rewrite orb_false_iff in *
@zunction
zunction / ortho.v
Last active February 26, 2020 02:50
for easier sharing of code written
From mathcomp Require Import all_ssreflect.
From void Require Import void.
From deriving Require Import deriving.
From Coq Require Import Extraction.
Require Import Coq.Strings.String.
Open Scope string_scope.
@zunction
zunction / new_ortho.v
Created March 10, 2020 01:15
latest file for sharing to shaowei
From mathcomp Require Import all_ssreflect.
From void Require Import void.
From deriving Require Import deriving.
From Coq Require Import Extraction.
Require Import Coq.Strings.String.
Open Scope string_scope.
@zunction
zunction / sw_ortho.v
Last active March 26, 2020 01:39
last edit on 26 Mar 0945hrs
From mathcomp Require Import all_ssreflect.
From void Require Import void.
From deriving Require Import deriving.
From Coq Require Import Extraction.
Require Import Coq.Strings.String.
Open Scope string_scope.