Skip to content

Instantly share code, notes, and snippets.

View xavieryao's full-sized avatar

Peiran Yao xavieryao

View GitHub Profile
@veekaybee
veekaybee / normcore-llm.md
Last active May 6, 2024 16:10
Normcore LLM Reads

Anti-hype LLM reading list

Goals: Add links that are reasonable and good explanations of how stuff works. No hype and no vendor content if possible. Practical first-hand accounts of models in prod eagerly sought.

Foundational Concepts

Screenshot 2023-12-18 at 10 40 27 PM

Pre-Transformer Models

@scateu
scateu / gist:6ceb04c2f107924d58374bb962cdcf76
Last active September 13, 2021 04:19
pbpaste.workflow
# Open "Automator.app", add a new "Quick Action"
# Workflow receives current "files or folders" in "Finder"
#+ Run Shell Script
#+ Shell: /bin/bash
#+ Pass input: as arguments
# Deployment: Keyboard / Shortcuts, bind 'Cmd-Shift-V'
# Usage: copy something to clipboard, click on a folder, press 'Cmd-Shift-V'.
# Contents will be pasted into 'pbpaste.txt'.
import torch
def jacobian(y, x, create_graph=False):
jac = []
flat_y = y.reshape(-1)
grad_y = torch.zeros_like(flat_y)
for i in range(len(flat_y)):
grad_y[i] = 1.
grad_x, = torch.autograd.grad(flat_y, x, grad_y, retain_graph=True, create_graph=create_graph)
jac.append(grad_x.reshape(x.shape))
@yzh119
yzh119 / st-gumbel.py
Created January 12, 2018 12:25
ST-Gumbel-Softmax-Pytorch
from __future__ import print_function
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
def sample_gumbel(shape, eps=1e-20):
U = torch.rand(shape).cuda()
return -Variable(torch.log(-torch.log(U + eps) + eps))
@kmatt
kmatt / config_conda.sh
Created February 4, 2015 17:51
Configure Vim to build with Anaconda as Python interpreter
./configure --with-features=huge --enable-pythoninterp --with-python-config-dir=~/anaconda/bin/python-config
@lsd
lsd / IdeaVim OS X Key Repeat.markdown
Last active May 3, 2024 07:22
Enable key-repeat for ALL applications or just for IdeaVim/specific JetBrains apps

Upgrading to Lion or Yosemite and WebStorm 9, I noticed key repeat was
turned off for the IdeaVim plugin h j k l keys.

System-wide key repeat

defaults write -g ApplePressAndHoldEnabled -bool false in a terminal will enable
key repeat for every app. This can alternatively be found in the accessibility settings in OS X' preferences.

App specific key repeat