Skip to content

Instantly share code, notes, and snippets.

View kyunghyuncho's full-sized avatar

Kyunghyun Cho kyunghyuncho

View GitHub Profile
@stephenroller
stephenroller / mixout.py
Last active February 10, 2023 23:49
Example of mixout on generic modules.
#!/usr/bin/env python3
"""
Example of a generic Mixout implementation. (Lee et al., 2019).
https://arxiv.org/abs/1909.11299
Implementation by Stephen Roller (https://stephenroller.com).
Updated 2020-02-10 to include 1/(1 - p) correction term. Thanks to
Cheolhyoung Lee for making this correction.
@dwf
dwf / sshft.sh
Created October 9, 2016 18:28
Easily forward ports through an SSH login node.
sshft() {
if [ $# -lt 2 ]; then
echo "usage: sshft host [port|local:remote|local:bridge:remote] ...]"
return 1
fi
if [ -z "$DEFAULT_SSH_PROXY_HOST" ]; then
echo "No DEFAULT_SSH_PROXY_HOST set."
return 1
fi
FIRST_SSH_ARGS="$DEFAULT_SSH_PROXY_HOST"