Skip to content

Instantly share code, notes, and snippets.

View justheuristic's full-sized avatar
💭
on github.com/learning-at-home

justheuristic justheuristic

💭
on github.com/learning-at-home
View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
"""symbolic helper functions"""
import theano
import theano.tensor as T
import lasagne
from lasagne.layers import *
import numpy as np
def get_mask(tokens,pad_ix=-1):
assert tokens.ndim==2
@justheuristic
justheuristic / gumbel_softmax.py
Created June 2, 2017 17:21
Mixture autoencoder with gumbel-softmax
# -*- coding: utf-8 -*-
"""
a bunch of lasagne code implementing gumbel softmax
https://arxiv.org/abs/1611.01144
"""
import numpy as np
import theano
import theano.tensor as T
from theano.sandbox.rng_mrg import MRG_RandomStreams as RandomStreams
from lasagne.random import get_rng
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#http://chemspipy.readthedocs.io/en/latest/guide/install.html
import chemspipy as chpy
token = "<your token from http://chemspipy.readthedocs.io/en/latest/guide/intro.html#securitytoken>"
cs = chpy.ChemSpider(token)
n_samples = 10**5 #amount of molecules to save
import numpy as np