Skip to content

Instantly share code, notes, and snippets.

Aditya Ramesh adityaramesh

Block or report user

Report or block adityaramesh

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@adityaramesh
adityaramesh / test.py
Created May 22, 2017
Plancherel's theorem
View test.py
import numpy as np
np.set_printoptions(precision=3, linewidth=200)
a = np.random.normal(size=(3, 3))
q, _ = np.linalg.qr(a)
print(np.matmul(q, q.T))
s = np.fft.fft2(q)
print(np.matmul(s, s.conj().T))
View solve.py
from sympy import Symbol, init_printing
from sympy.solvers import solve
from IPython.display import display
init_printing()
x1 = Symbol('x1')
x2 = Symbol('x2')
y = Symbol('y')
View gist:e31f9bafee2a85243f1d4714fd3cb1ff
require('nn')
require('nngraph')
local m
do
local x1, x2 = nn.Identity()(), nn.Identity()()
local y = nn.Bilinear(2, 2, 2){x1, x2}
m = nn.gModule({x1, x2}, {y})
end
@adityaramesh
adityaramesh / parse_memory_string.py
Last active Feb 15, 2016
Converts a human-readable memory string (e.g. "256 GiB") into an integral byte count.
View parse_memory_string.py
import re
def parse_memory_string(mem_str):
"""
Returns the number of bytes represented by a string ``mem_str`` matching the following
regex: ::
r'^(0|[1-9][0-9]*) (byte|bytes|KiB|MiB|GiB|TiB)'
If ``mem_str`` does not match this regex, then ``None`` is returned.
@adityaramesh
adityaramesh / mach_thread_test
Last active Aug 29, 2015
A simple "Hello, world" program using Mach threads.
View mach_thread_test
#include <iostream>
#include <unistd.h>
#include <mach/mach.h>
#include <mach/mach_vm.h>
#include <mach/mach_error.h>
#include <mach/mach_init.h>
#include <mach/mach_types.h>
#include <mach/mach_traps.h>
You can’t perform that action at this time.