This file contains 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 numpy as np | |
import sgf # pip install sgf -- simple parser for the file format | |
import timeit | |
def decode_position(pos_string): | |
# position in .sgf is char[2] and row-first, e.g. "fd" | |
positions = "abcdefghijklmnopqrs" | |
x = positions.index(pos_string[0]) | |
y = positions.index(pos_string[1]) | |
return y, x |
This file contains 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 numpy as np | |
import sgf # pip install sgf -- simple parser for the file format | |
def decode_position(pos_string): | |
# position in .sgf is char[2] and row-first, e.g. "fd" | |
positions = "abcdefghijklmnopqrs" | |
x = positions.index(pos_string[0]) | |
y = positions.index(pos_string[1]) | |
return y, x |
This file contains 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
from keras.models import Sequential | |
from keras.layers import Dense, Flatten | |
model1 = Sequential() | |
model1.add(Dense(1, input_shape=(10,10))) | |
model2 = Sequential() | |
model2.add(Flatten(input_shape=(10,10))) | |
model2.add(Dense(1)) |
This file contains 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
'''Train a simple residual network on the CIFAR10 small images dataset. | |
It gets to 75% validation accuracy in 25 epochs, and 79% after 50 epochs. | |
(it's still underfitting at that point, though). | |
''' | |
from __future__ import print_function | |
import keras | |
from keras.datasets import cifar10 | |
from keras.preprocessing.image import ImageDataGenerator |
This file contains 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
from keras.engine.topology import Layer | |
from keras.layers importActivation, Conv2D, Add | |
class Residual(Layer): | |
def __init__(self, channels_in,kernel,**kwargs): | |
super(Residual, self).__init__(**kwargs) | |
self.channels_in = channels_in | |
self.kernel = kernel | |
def call(self, x): |
This file contains 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
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. | |
# | |
# 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 | |
# | |
# http://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, |
This file contains 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 requests | |
# to be filled in by you | |
token = "" # if you have signed up at https://scoreboard-190810.appspot.com | |
# you can find it on the top left corner of the page | |
environment = "Test-v0" # name of the environment the agent is for | |
data = { | |
"name": "My Agent Name", # you wrote it, you get to name it =) | |
"score": "1337", # replace with actual score |
This file contains 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
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. | |
# | |
# 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 | |
# | |
# http://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, |
This file contains 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
#!/bin/bash | |
docker-machine scp -r . myRegistry:~ | |
docker-machine ssh myRegistry docker load -i registry.tar | |
docker-machine ssh myRegistry sudo cp -r certs /var/lib/boot2docker | |
docker-machine ssh myRegistry docker stack deploy --compose-file=docker-compose.yml registry |
This file contains 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
version: '3' | |
services: | |
registry: | |
image: registry:2 | |
ports: | |
- "443:5000" | |
volumes: | |
- "/var/lib/boot2docker/certs:/certs" | |
- "registry_data:/data" |