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
| # Context manager to generate batches in the background via a process pool | |
| # Usage: | |
| # | |
| # def batch(seed): | |
| # .... # generate minibatch | |
| # return minibatch | |
| # | |
| # with BatchGenCM(batch) as bg: | |
| # minibatch = next(bg) | |
| # .... # do something with minibatch |
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
| # Benchmark to compare the times for storing numpy arrays in a key-value. | |
| # The main point is to compare numpy serialization vs a bcolz approach. | |
| from __future__ import print_function | |
| import sys | |
| import os | |
| import os.path | |
| import subprocess | |
| import getopt |
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.
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
| " Put this in your .vimrc and whenever you `git commit` you'll see the diff of your commit next to your commit message. | |
| " For the most accurate diffs, use `git config --global commit.verbose true` | |
| " BufRead seems more appropriate here but for some reason the final `wincmd p` doesn't work if we do that. | |
| autocmd VimEnter COMMIT_EDITMSG call OpenCommitMessageDiff() | |
| function OpenCommitMessageDiff() | |
| " Save the contents of the z register | |
| let old_z = getreg("z") | |
| let old_z_type = getregtype("z") |
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
| """ | |
| A minimal implementation of Monte Carlo tree search (MCTS) in Python 3 | |
| Luke Harold Miles, July 2019, Public Domain Dedication | |
| See also https://en.wikipedia.org/wiki/Monte_Carlo_tree_search | |
| https://gist.github.com/qpwo/c538c6f73727e254fdc7fab81024f6e1 | |
| """ | |
| from abc import ABC, abstractmethod | |
| from collections import defaultdict | |
| import math |
OlderNewer