Skip to content

Instantly share code, notes, and snippets.

View lzamparo's full-sized avatar

Lee Zamparo lzamparo

View GitHub Profile
@anna-hope
anna-hope / dynamic_k_max.py
Last active October 9, 2019 06:06
Dynamic K-Max pooling in PyTorch (Kalchbrenner et al. 2014)
# Based on https://arxiv.org/pdf/1404.2188.pdf
# Anton Melnikov
import torch
from torch import nn
import torch.nn.functional as F
import numpy as np
class DynamicKMaxPooling(nn.Module):
def __init__(self, k_top, L):
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kastnerkyle
kastnerkyle / conv_deconv_vae.py
Last active April 21, 2023 01:18
Convolutional Variational Autoencoder, modified from Alec Radford at (https://gist.github.com/Newmu/a56d5446416f5ad2bbac)
# Alec Radford, Indico, Kyle Kastner
# License: MIT
"""
Convolutional VAE in a single file.
Bringing in code from IndicoDataSolutions and Alec Radford (NewMu)
Additionally converted to use default conv2d interface instead of explicit cuDNN
"""
import theano
import theano.tensor as T
from theano.compat.python2x import OrderedDict
# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.
@Newmu
Newmu / adam.py
Last active August 11, 2019 22:24
Adam Optimizer
"""
The MIT License (MIT)
Copyright (c) 2015 Alec Radford
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@syhw
syhw / dnn.py
Last active January 24, 2024 19:38
A simple deep neural network with or w/o dropout in one file.
"""
A deep neural network with or w/o dropout in one file.
License: Do What The Fuck You Want to Public License http://www.wtfpl.net/
"""
import numpy, theano, sys, math
from theano import tensor as T
from theano import shared
from theano.tensor.shared_randomstreams import RandomStreams
@davfre
davfre / bamfilter_oneliners.md
Last active February 24, 2024 01:23
SAM and BAM filtering oneliners