Skip to content

Instantly share code, notes, and snippets.

View MannyKayy's full-sized avatar

Emmanuel Kahembwe MannyKayy

View GitHub Profile
@MannyKayy
MannyKayy / Dockerfile
Last active January 25, 2018 12:04
ChainerMN Dockerfile
FROM nvidia/cuda:8.0-cudnn6-devel-ubuntu14.04
RUN apt-get update
# disable interactive functions
ENV DEBIAN_FRONTEND noninteractive
#################Install MiniConda and other dependencies##########
ENV CONDA_DIR /opt/conda
@MannyKayy
MannyKayy / fc_densenet.py
Created June 8, 2017 16:12 — forked from felixgwu/fc_densenet.py
FC-DenseNet Implementation in PyTorch
import torch
from torch import nn
__all__ = ['FCDenseNet', 'fcdensenet_tiny', 'fcdensenet56_nodrop',
'fcdensenet56', 'fcdensenet67', 'fcdensenet103',
'fcdensenet103_nodrop']
class DenseBlock(nn.Module):
@MannyKayy
MannyKayy / treernn.py
Created June 8, 2017 16:13 — forked from felixgwu/treernn.py
Pytorch TreeRNN
"""
TreeLSTM[1] implementation in Pytorch
Based on dynet benchmarks :
https://github.com/neulab/dynet-benchmark/blob/master/dynet-py/treenn.py
https://github.com/neulab/dynet-benchmark/blob/master/chainer/treenn.py
Other References:
https://github.com/pytorch/examples/tree/master/word_language_model
https://github.com/pfnet/chainer/blob/29c67fe1f2140fa8637201505b4c5e8556fad809/chainer/functions/activation/slstm.py
https://github.com/stanfordnlp/treelstm
@MannyKayy
MannyKayy / using chainercv and chainermn together
Last active June 9, 2017 12:33
This code doesn't run. pickle and mpi related error
#!/usr/bin/env python
from __future__ import print_function
import argparse
import chainer
import chainer.functions as F
import chainer.links as L
from chainer import training
from chainer.training import extensions
@MannyKayy
MannyKayy / detect.py
Created October 15, 2017 21:25 — forked from Lukse/detect.py
Advanced OpenCV 3 python hole detection
import cv2
import sys
import numpy as np
camera = cv2.VideoCapture("video.avi")
# Setup BlobDetector
detector = cv2.SimpleBlobDetector_create()
params = cv2.SimpleBlobDetector_Params()
@MannyKayy
MannyKayy / tied_weight_ae.py
Created October 17, 2017 18:50 — forked from delta2323/tied_weight_ae.py
Chainer example of Tied-weight Autoencoder (Autoencoder with sharing weights)
import chainer
import chainer.functions as F
from chainer import initializers as I
from chainer import reporter
from chainer import training
from chainer.training import extensions as E
import numpy
import scipy.misc
class ConvolutionalAutoEncoder(chainer.Chain):
def __init__(self):
super(ConvolutionalAutoEncoder).__init__(
c1=L.Convolution2D(...),
c2=L.Convolution2D(...),
dc1=L.Deconvolution2D(...),
dc2=L.Deconvolution2D(...),
)
def convolve(self, x):
@MannyKayy
MannyKayy / gaussian-processes-1.ipynb
Created December 18, 2017 00:16 — forked from abridgland/gaussian-processes-1.ipynb
A Jupyter notebook to accompany Intro to Gaussian Processes - Part I at http://bridg.land/posts/gaussian-processes-1
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@MannyKayy
MannyKayy / gaussian-processes-1.ipynb
Created December 18, 2017 00:16 — forked from abridgland/gaussian-processes-1.ipynb
A Jupyter notebook to accompany Intro to Gaussian Processes - Part I at http://bridg.land/posts/gaussian-processes-1
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import os
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import chainer
from chainercv.datasets import cityscapes_semantic_segmentation_label_colors
from chainercv.datasets import cityscapes_semantic_segmentation_label_names
from chainercv.datasets import voc_bbox_label_names