View progbar.h
#include <iostream>
#include <chrono>
#include <ratio>
class progbar {
private:
int call_count = 0;
// formatting:
View log.h
#ifndef _LOG_H_
#define _LOG_H_
// logging utils
//
#include <iostream>
#include <ctime>
#define LOG(level) ::log_internal::_log_helper<::log_internal::loglevel:: level >(__FILE__, __LINE__, __FUNCTION__)
View readnp.h
#ifndef _READNP_H_
#define _READNP_H_
// Simple header-only library for loading serialized numpy arrays.
// Only for testing.
#include <algorithm>
#include <cassert>
#include <fstream>
#include <regex>
#include <string>
View arxiv2kindle.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View arxiv_bash_aliases.sh
function arxiv-authors() {
if [ $# -ne 1 ]; then
echo "Usage: arxiv-authors arxiv_url_or_id"
echo "Prints authors' names, one per line."
else
if [[ $1 == http* ]]; then
url=$1
else
url=http://arxiv.org/abs/$1
fi
View lbfgs_new.lua
--[[ An implementation of L-BFGS, heavily inspired by minFunc (Mark Schmidt)
This implementation of L-BFGS relies on a user-provided line
search function (state.lineSearch). If this function is not
provided, then a simple learningRate is used to produce fixed
size steps. Fixed size steps are much less costly than line
searches, and can be useful for stochastic problems.
The learning rate is used even when a line search is provided.
This is also useful for large-scale stochastic problems, where
View 2015-01-16-practicals-install-torch.sh
#!/bin/bash
##############################
# install Torch
# export PREFIX=/home/scratch/$USER/torch
export PREFIX="/home/scratch/torchshared/torch"
mkdir -p $PREFIX
rm -rf /tmp/luajit-rocks
View directions.py
"""
Google Directions API
"""
import urllib2
import urllib
import json
class Modes:
DRIVING="driving"
View property_dict.py
# -*- coding: utf-8 -*-
__author__ = 'brendan'
import collections
class property_dict(collections.Mapping):
"""
Dictionary wrapper that adapts a dict with a wrapper allowing property-style reads. Intended
for ease of JSON accessing.
View logtype.py
__author__ = 'brendan'
__all__ = ['logfloat', 'LogFloat']
import numpy as np # numpy's logaddexp correctly handles LOGZERO
from math import log as _log, exp as _exp
@np.vectorize
def logfloat(x):
"""