Skip to content

Instantly share code, notes, and snippets.

@botev
botev / mnist_hinton.py
Last active January 25, 2016 18:45
Hinton Autoencoder for theano and tf for benchmarking
from __future__ import print_function
import numpy as np
import os
import gzip
import sys
import time
from collections import OrderedDict
floatX = "float32"
@botev
botev / eigen.cpp
Created January 19, 2016 13:36
Mnist Hinton network with Eigen
//
// Created by alex on 18/01/16.
//
// Compiled with
// MKL_NUM_THREADS=4 OMP_NUM_THREADS=4 g++ -O3 -std=c++11 \
// -I/opt/eigen -I/opt/intel/mkl/include -Wall -L/opt/intel/mkl/lib/intel64 \
// -Werror=return-type -Wno-unused-variable -Wno-narrowing -Wl,--no-as-needed \
// -m64 -fopenmp -lmkl_rt -lpthread -lcurl -lm eigen.cpp
#define EIGEN_USE_MKL_ALL
#include "Eigen/Core"
@botev
botev / test.cpp
Created April 27, 2016 21:09
Time my_reduce
//
// Created by alex on 26/04/16.
//
#include "arrayfire.h"
#include "myreduce.h"
#include "stdio.h"
#include "iostream"
static const int n = 100;
static const int M = 200;
@botev
botev / Iterator.cpp
Last active May 17, 2016 11:38
Iterator for arrayfire
#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <iterator>
#include "arrayfire.h"
class AbstractDataSource{
protected:
unsigned instance_dim;
//
// Created by alex on 17/06/16.
//
#include "arrayfire.h"
#include "iomanip"
class BinaryCrossEntropy{
public:
inline
af::array func(af::array prediction, af::array targets){
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@botev
botev / qtip
Created October 20, 2016 10:25
<!doctype html>
<html>
<head>
<title>MNIST</title>
<!-- jQuery -->
<script src="http://code.jquery.com/jquery-2.0.3.min.js"></script>
<!-- Cytoscape -->
<script src="http://cytoscape.github.io/cytoscape.js/api/cytoscape.js-latest/cytoscape.min.js"></script>
<!-- Dagre -->
<script src="https://cdn.rawgit.com/cpettitt/dagre/v0.7.4/dist/dagre.min.js"></script>
@botev
botev / tensor_shapes.rs
Last active December 15, 2016 02:40
Demonstrating how we can use symbolic integer for automatic shape inference and verification.
use std::collections::HashMap;
extern crate symints;
use symints::*;
type SymInt = Polynomial<String, i64, u8>;
type Shape = (SymInt, SymInt, SymInt, SymInt);
enum ConvolutionMode {
@botev
botev / Theano_cuSOLVER.py
Last active March 23, 2017 13:43
Theano + cuSOLVER
from __future__ import absolute_import, print_function, division
import numpy as np
import theano
from theano import Op
import theano.tensor as T
from theano.gpuarray.basic_ops import (gpu_contiguous, as_gpuarray_variable,
infer_context_name)
from theano.gpuarray.type import get_context
@botev
botev / run_yellow_fin_vae.py
Last active July 13, 2017 13:42
Theano Yellow Fin
import numpy as np
import argparse
import theano
import theano.tensor as T
from theano.sandbox.rng_mrg import MRG_RandomStreams as RandomStreams
from theano.gradient import zero_grad
import lasagne.layers as L