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
| import time | |
| from contextlib import suppress | |
| import torch | |
| import torch.nn as nn | |
| import torch.optim as optim | |
| import torch.nn.functional as F | |
| import torch.backends.cuda as cuda | |
| from torch.utils.data import DataLoader, IterableDataset |
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
| 'use strict' | |
| // ideal for use with AWS Lambda and native Node.js modules | |
| // requires Docker: https://docs.docker.com/engine/installation/ | |
| /* | |
| Usage: | |
| node docker-npm.js install | |
| node docker-npm.js rebuild |
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
| 'use strict'; | |
| /* eslint-disable consistent-this */ | |
| let applyMiddlewareHash = []; | |
| /** | |
| * Composes single-argument functions from right to left. The rightmost | |
| * function can take multiple arguments as it provides the signature for | |
| * the resulting composite function. | |
| * |
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 xcrun swift | |
| /* | |
| gen.swift is a direct port of cfdrake's helloevolve.py from Python 2.7 to Swift 3 | |
| -------------------- https://gist.github.com/cfdrake/973505 --------------------- | |
| gen.swift implements a genetic algorithm that starts with a base | |
| population of randomly generated strings, iterates over a certain number of | |
| generations while implementing 'natural selection', and prints out the most fit | |
| string. |
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
| rbenv global 2.2.2 | |
| sudo service elasticsearch stop | |
| if ! [ -e .semaphore-cache/elasticsearch-2.2.1.deb ]; then (cd .semaphore-cache; curl -OL https://download.elasticsearch.org/elasticsearch/release/org/elasticsearch/distribution/deb/elasticsearch/2.2.1/elasticsearch-2.2.1.deb); fi | |
| echo Y | sudo dpkg -i .semaphore-cache/elasticsearch-2.2.1.deb | |
| sudo service elasticsearch start | |
| sleep 5 && curl -XGET 'localhost:9200' |