Skip to content

Instantly share code, notes, and snippets.

View ybj14's full-sized avatar
๐Ÿ 
Working from home

Binjie Yuan ybj14

๐Ÿ 
Working from home
  • Tsinghua University
  • Beijing
View GitHub Profile
@ybj14
ybj14 / fluent-sync.sh
Created June 13, 2026 17:07
fluent-sync.sh โ€” sync Fluent learning data + plugin fork across machines
#!/usr/bin/env bash
#
# fluent-sync.sh โ€” keep your Fluent learning data in sync across machines
# using a PRIVATE GitHub repository.
#
# init Machine 1 (first time): create the private repo, commit, push.
# clone Machine 2 (first time): clone the repo into the data dir.
# push After a session: commit local changes and upload.
# pull Before/after switching machines: download latest.
# sync The everyday command: pull --rebase then push.
@ybj14
ybj14 / jvp.py
Last active November 20, 2022 06:51
JVP
# Refer to `https://j-towns.github.io/2017/06/12/A-new-trick.html` for math details.
import torch
from torch import nn
from torch import autograd
def get_jvp(net, x, v):
'''
Generate jacobian vector product. Requires x.requires_grad()
and v.requires_grad().
Args: