Skip to content

Instantly share code, notes, and snippets.

Avatar

Masahiro Sakai msakai

View GitHub Profile
View rnn_weight_shapes.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@msakai
msakai / .block
Created Nov 7, 2019 — forked from fancellu/.block
Force directed graph for D3.js v4 with labelled edges and arrows
View .block
license: gpl-3.0
height: 600
View int_object.py
print(0x10000000000000000 is 0x10000000000000000)
#=> True
import dis
b = dis.Bytecode(lambda: 0x10000000000000000 is 0x10000000000000000)
print(b.dis())
#=>
# 4 0 LOAD_CONST 1 (18446744073709551616)
# 2 LOAD_CONST 1 (18446744073709551616)
# 4 COMPARE_OP 8 (is)
View smooth_functions.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View weekday10000.csv
year month day wday
2158 4 19 3
2020 8 11 2
2010 5 15 6
2088 11 30 2
2181 5 28 1
2162 5 16 0
2175 11 17 5
2018 4 5 4
2287 1 24 1
@msakai
msakai / citeusync.py
Last active Apr 7, 2019 — forked from willwade/citeusync.py
inspired by the perl version - but not quite the same. Simply use to download your bibtex file and attachments on a regular basis. NB: Only downloads the PDF if not already present so technically only 2 calls at a minimum to CUL (Login and download of bibtex. Obviously a lot more if downloading the PDFs). If more than one attachment - will only …
View citeusync.py
#!/usr/bin/env python
# Contact: Will Wade willwa.de
# Date: April 2013
# Needs mechanize and pybtex
#
# NB: Little error checking going on in this script
# TO-DO: Check last-download-date of bibtex file later than last-modified date on CUL. ? possible
#
# With thanks to https://pypi.python.org/pypi/citeulike_api/0.1.3dev for the login part
import mechanize
View batch_numpy.py
from abc import ABCMeta, abstractmethod
import numpy as np
import scipy.linalg
import pivots
def beye(nBatch, n, dtype):
return np.broadcast_to(np.expand_dims(np.eye(n, dtype=dtype), 0), (nBatch, n, n))
View factor.py
import numpy as np
import scipy.linalg
import pivots
def factor(A, B, C):
"""
factor(A, B, C)(D) compute LU factorization of
X = (A B)
View qpth_solvers_pdipm_single_numpy.py
# numpy/scipy translation of https://github.com/locuslab/qpth/blob/5485219028a7687b76107c8431625aaedfd7bc36/qpth/solvers/pdipm/single.py
import numpy as np
import scipy
import scipy.linalg
# TODO: Add more comments describing the math here.
# https://stanford.edu/~boyd/papers/pdf/code_gen_impl.pdf
@msakai
msakai / JM.agda
Created Oct 6, 2018
Proof of K and UIP from elimination rule of John Major equality
View JM.agda
{-# OPTIONS --with-K #-}
module JM where
open import Level
infix 4 _≅_
data _≅_ {ℓ} {A : Set ℓ} (x : A) : {B : Set ℓ} B Setwhere
≅-refl : x ≅ x