Skip to content

Instantly share code, notes, and snippets.

View MannyKayy's full-sized avatar

Emmanuel Kahembwe MannyKayy

View GitHub Profile
@MannyKayy
MannyKayy / .tmux.conf
Created August 20, 2020 19:14 — forked from joar/.tmux.conf
tmux: Enable mouse scrolling, windown and pane select. Also provides a binding to disable/enable mouse for copy/pase.
# mouse-mode
set-window-option -g mode-mouse on
set-option -g mouse-resize-pane on
set-option -g mouse-select-pane on
set-option -g mouse-select-window on
# toggle mouse mode to allow mouse copy/paste
# set mouse on with prefix m
bind m \
set -g mode-mouse on \;\
@MannyKayy
MannyKayy / .tmux.conf
Created August 20, 2020 19:14 — forked from joar/.tmux.conf
tmux: Enable mouse scrolling, windown and pane select. Also provides a binding to disable/enable mouse for copy/pase.
# mouse-mode
set-window-option -g mode-mouse on
set-option -g mouse-resize-pane on
set-option -g mouse-select-pane on
set-option -g mouse-select-window on
# toggle mouse mode to allow mouse copy/paste
# set mouse on with prefix m
bind m \
set -g mode-mouse on \;\
@MannyKayy
MannyKayy / ignite.py
Created August 20, 2020 01:37 — forked from take0212/ignite.py
ignite with wrapped torch model
import argparse
import chainer
import chainer.functions as F
import chainer.links as L
from chainer import training
from chainer.training import extensions
import chainerx
import numpy
from chainer.dataset import concat_examples
@MannyKayy
MannyKayy / stream_cupy_to_numba.py
Created August 20, 2020 01:13 — forked from leofang/stream_cupy_to_numba.py
Convert CuPy stream to Numba stream
# Many Python libraries provide low-level CUDA support, but when it comes to interoperability
# things get complicated. This script shows a simple example on converting a CUDA stream
# created from CuPy's API to one that is compatible with Numba.
from numba import cuda
import cupy as cp
def stream_cupy_to_numba(cp_stream):
@MannyKayy
MannyKayy / gist:09050568b62c079beee29893fd5c289e
Created November 19, 2019 15:35 — forked from darkyen/gist:120c46739985ebf3b39b
Ferengi Rules of Acquisition [Complete List*]
1 "Once you have their money, you never give it back." "The Nagus" (DS9 episode)
2 "The best deal is the one that makes the most profit." The 34th Rule (DS9 novel)
3 "Never spend more for an acquisition than you have to." "The Maquis, Part II" (DS9 episode)
4 "A woman wearing clothes is like a man in the kitchen." The Ferengi Rules of Acquisition (DS9 novel)
5 "Always exaggerate your estimates." Cold Fusion (SCE novel)
6 "Never let family stand in the way of opportunity." "The Nagus" (DS9 episode)
7 "Always keep your ears open." "In the Hands of the Prophets" (DS9 episode)
8 "Small print leads to large risk." The Ferengi Rules of Acquisition (DS9 novel)
9 "Instinct, plus opportunity, equals profit." "The Storyteller" (DS9 episode)
10 "Greed is eternal." "Prophet Motive" (VOY episode)
@MannyKayy
MannyKayy / cosine_annealing.py
Created November 18, 2019 07:59 — forked from hrsma2i/cosine_annealing.py
# Chainer SGDR, Cosine Annealing
from math import cos, pi
import numpy
from chainer.training import extension
class CosineAnnealing(extension.Extension):
def __init__(self, lr_max, lr_min=0, T_0=1, T_mult=2,
optimizer=None):
super(CosineAnnealing, self).__init__()
@MannyKayy
MannyKayy / cosine_annealing.py
Created November 18, 2019 07:59 — forked from hrsma2i/cosine_annealing.py
# Chainer SGDR, Cosine Annealing
from math import cos, pi
import numpy
from chainer.training import extension
class CosineAnnealing(extension.Extension):
def __init__(self, lr_max, lr_min=0, T_0=1, T_mult=2,
optimizer=None):
super(CosineAnnealing, self).__init__()
@MannyKayy
MannyKayy / grad_reverse.py
Created December 28, 2018 00:08
Gradient Reversal Layer (GRL) in Chainer
# Reference
# https://docs.chainer.org/en/stable/guides/functions.html
import chainer.functions as F
import chainer.links as L
import numpy as np
from chainer import Function
from chainer import Variable
@MannyKayy
MannyKayy / ACAI (PyTorch).ipynb
Created July 31, 2018 15:22 — forked from kylemcdonald/ACAI (PyTorch).ipynb
PyTorch ACAI (1807.07543).
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@MannyKayy
MannyKayy / sub_pixel_convolution2d_chainerv2.py
Created May 16, 2018 23:41 — forked from oyam/sub_pixel_convolution2d_chainerv2.py
Sub-pixel convolutional upscaling layer based on the paper "Real-Time Single Image and Video Super-Resolution Using an Efficient Sub-Pixel Convolutional Neural Network" for Chainer v2
from chainer.functions.connection import convolution_2d
from chainer import initializers
from chainer import link
import chainer.functions as F
class SubPixelConvolution2D(link.Link):
""" Sub-pixel convolutional upscaling layer based on the paper "Real-Time Single Image
and Video Super-Resolution Using an Efficient Sub-Pixel Convolutional Neural Network"