Skip to content

Instantly share code, notes, and snippets.

View ceshine's full-sized avatar

CeShine Lee ceshine

View GitHub Profile
@larryli
larryli / GIT_SSH_COMMAND.sh
Last active January 21, 2021 20:35
Git ssh socks proxy
#!/bin/sh
export GIT_SSH_COMMAND='ssh -o ProxyCommand="connect -S 127.0.0.1:1080 %h %p"'
git config --global core.sshCommand 'ssh -o ProxyCommand="connect -S 127.0.0.1:1080 %h %p"'
git clone -c=core.sshCommand 'ssh -o ProxyCommand="connect -S 127.0.0.1:1080 %h %p"' [email protected]:larryli/ipv4.git
git config core.sshCommand 'ssh -o ProxyCommand="connect -S 127.0.0.1:1080 %h %p"'

Note: I'm updating this gist as I encounter new reviews, so make sure you're reading the latest revision!

Just as the previous year I collected (and keep doing so) links to various summaries and takeaways from this year's NIPS.

@frfahim
frfahim / oh-my-fish.md
Last active January 10, 2025 15:20
Install fish shell and oh-my-fish on ubuntu

First install fish shell on your system

sudo apt-get update
sudo apt-get install fish

Or install fish via ppa

sudo apt-add-repository ppa:fish-shell/release-2
sudo apt-get update

sudo apt-get install fish``

@rtqichen
rtqichen / pytorch_weight_norm.py
Last active May 11, 2023 06:58
Pytorch weight normalization - works for all nn.Module (probably)
## Weight norm is now added to pytorch as a pre-hook, so use that instead :)
import torch
import torch.nn as nn
from torch.nn import Parameter
from functools import wraps
class WeightNorm(nn.Module):
append_g = '_g'
append_v = '_v'
@shgidi
shgidi / plot_loss+sample.py
Created July 12, 2017 10:30
plots loss in keras, additionally plots segmentation in image
#https://gist.github.com/stared/dfb4dfaf6d9a8501cd1cc8b8cb806d2e
class PlotLosses(keras.callbacks.Callback):
def __init__(self,imgs):
super(PlotLosses, self).__init__()
self.imgs=imgs
def on_train_begin(self, logs={}):
self.i = 0
self.x = []
@kevinzakka
kevinzakka / data_loader.py
Last active March 16, 2025 18:14
Train, Validation and Test Split for torchvision Datasets
"""
Create train, valid, test iterators for CIFAR-10 [1].
Easily extended to MNIST, CIFAR-100 and Imagenet.
[1]: https://discuss.pytorch.org/t/feedback-on-pytorch-for-kaggle-competitions/2252/4
"""
import torch
import numpy as np
@primaryobjects
primaryobjects / react-confirm.js
Created November 1, 2017 19:03
A simple example of a confirm alert dialog in ReactJs / React.
<div className='delete-button' onClick={() => { if (window.confirm('Are you sure you wish to delete this item?')) this.onCancel(item) } } />
@oseiskar
oseiskar / simdkalman-kaggle-example.ipynb
Last active February 17, 2023 19:54
simdkalman example: Kaggle Web Traffic Time Series Forecasting
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@superMDguy
superMDguy / add_weather.py
Last active February 24, 2018 20:47
Adds weather data to dataset for kaggle "Recruit Restaurant Visitor Forecasting" competition
train.visit_date = pd.to_datetime(train.visit_date)
test.visit_date = pd.to_datetime(test.visit_date)
def add_weather(dataset):
print('Adding weather...')
air_nearest = pd.read_csv(
'../../data/raw/weather/air_store_info_with_nearest_active_station.csv')
unique_air_store_ids = list(dataset.air_store_id.unique())
weather_dir = '../../data/raw/weather/1-1-16_5-31-17_Weathe
@deargle
deargle / tokenize.py
Last active April 22, 2021 12:32
Example of TfidfVectorizer with custom tokenizer that does basic stemming
# -*- coding: utf-8 -*-
"""
Created on Tue Apr 24 16:30:42 2018
@author: deargle
"""
from sklearn.feature_extraction.text import TfidfVectorizer
from nltk.stem.porter import PorterStemmer
import nltk