This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // generate [0..n-1] | |
| auto seq = [](size_t n) -> std::vector<size_t> { | |
| std::vector<size_t> v(n); | |
| for (size_t i=0; i<n; ++i) v[i] = i; | |
| return v; | |
| }; | |
| auto index = seq(n); | |
| // n * n distance matrix | |
| std::vector<D> dists(n * n); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Resulting video from this code can be seen here: | |
| # http://www.ifweassume.com/2015/02/world-population-density.html | |
| # or | |
| # https://vimeo.com/120308257 | |
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| from mpl_toolkits.basemap import Basemap | |
| import os |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| # This is a simplified implementation of the LSTM language model (by Graham Neubig) | |
| # | |
| # LSTM Neural Networks for Language Modeling | |
| # Martin Sundermeyer, Ralf Schlüter, Hermann Ney | |
| # InterSpeech 2012 | |
| # | |
| # The structure of the model is extremely simple. At every time step we |