Skip to content

Instantly share code, notes, and snippets.

View gist:6438c8571a730f4d4c2d22482d36146b
{# pre-pull images into each node with "pulling concurrency control" #}
{% set image = "your_repo/your_image:your_tag" %}
{% set docker_registry_credential = "your-cred" %}
{% set node_key = "type" %}
{% set node_value = "cpu" %}
{% set n_nodes = 1 %}
{# this concurrency number can be gradually changed afterwards, by using, e.g., k edit your_replicaset #}
kind: ReplicaSet
apiVersion: extensions/v1beta1
View gist:4817875882b6f7f2b30d5a1026547861
#### dev-horovod
python run_experiment_mm_raw.py \
--workers_csv_path=sandbox/a_2.csv \
--level_name=PongNoFrameskip-v4 \
--batch_size=32 \
--entropy_cost=0.0033391318945337044 \
--learning_rate=0.00031 \
--total_environment_frames=10000000000 \
--reward_clipping=soft_asymmetric
View scalable_agent commands
# learner
python experiment.py \
--job_name=learner --task=0 \
--num_actors=1 \
--level_name=dmlab30 --batch_size=2 \
--entropy_cost=0.0033391318945337044 \
--learning_rate=0.00031866995608948655 \
--total_environment_frames=1000 \
--reward_clipping=soft_asymmetric
View run_sc2
"""
Minimal example to run scii with raw api.
First, cd to the sc2 binary dir and run command:
./SC2_x64 -listen 127.0.0.1 -port 5000
Then, run this script in another terminal.
"""
from s2clientprotocol import common_pb2 as sc_common
View multiplayer_example.py
"""
Copyright 2017 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
View sc2_base.py
"""
Copyright 2017 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
View timing_lookuptable.lua
require'cunn'
require'cudnn'
--V = 30000 + 1 -- vocabulary size
--C = 500
--M = 80 -- seq length
--B = 100 -- #batches
--padVocabInd = 1
--MP = M * p
View lookuptable_updateOutput.cu
__global__ void OHNN_CudaLookupTable2_updateOutput_kernel(
float *inputInd, float *weight, int weightStride, int B, int M, int V, int C,
float *output, int outputStride)
{
int iFet = blockIdx.x * blockDim.x + threadIdx.x;
int iWord = blockIdx.y * blockDim.y + threadIdx.y;
if (iFet < C && iWord < B*M) {
int iVocab = (int)(inputInd[iWord] - 1); // C zero base <- lua one base
int nSrc = iVocab * weightStride + iFet;
int nDst = iWord * outputStride + iFet;
View timing_lt_sl.lua
-- nn.LookupTable vs nn.SparseLinear
require'cunn'
V = 30000 -- vocabulary size
C = 500 -- output dim
B = 100*500 -- #batches
nloop = 3
-- onehot input
View myinstalltorch.sh
# remove the old torch 7
cd ~
rm -rf torch
# install torch 7 with lua52 (as workaround to 2GB memory limit of luajit)
curl -s https://raw.githubusercontent.com/torch/ezinstall/master/install-deps | bash
git clone https://github.com/torch/distro.git ~/torch --recursive
cd ~/torch
TORCH_LUA_VERSION=LUA52 ./install.sh