Skip to content

Instantly share code, notes, and snippets.

View ematvey's full-sized avatar

Matvey Ezhov ematvey

View GitHub Profile
@ematvey
ematvey / transforms.py
Last active September 18, 2018 08:50
Affine augmentations for 3D tensors targeted at medical images
import math
from typing import Union, NamedTuple
import numpy as np
from scipy.ndimage import affine_transform
class AffineTransform(NamedTuple):
matrix: np.ndarray
offset: np.ndarray
@louisng5
louisng5 / README
Last active November 14, 2016 10:33
OpenAI - CartPole-v0 - 19 EPISODES BEFORE SOLVE
I have used some aggressive measure to achieve 19 Episodes before solve, inculding:
1) Large batch_size used for experience replay.
2) 30 epoch size used for every training batch.
3) 0 probability for random action.
With this approach, the NN start to "know" how to balance at episode 10-15.
Keras was used for creating and training the NN.
@karpathy
karpathy / pg-pong.py
Created May 30, 2016 22:50
Training a Neural Network ATARI Pong agent with Policy Gradients from raw pixels
""" Trains an agent with (stochastic) Policy Gradients on Pong. Uses OpenAI Gym. """
import numpy as np
import cPickle as pickle
import gym
# hyperparameters
H = 200 # number of hidden layer neurons
batch_size = 10 # every how many episodes to do a param update?
learning_rate = 1e-4
gamma = 0.99 # discount factor for reward
@martinrusev
martinrusev / cron_supervisord.ini
Last active June 1, 2024 03:27
Cron supervisord
[supervisord]
nodaemon=true
loglevel=debug
[program:amon]
command=gunicorn -c gunicorn.conf.py wsgi
directory=/amon
autostart=true
autorestart=true
redirect_stderr=true
@bellbind
bellbind / genetic.py
Created December 15, 2010 10:46
[python]Genetic Algorithm example
"""Genetic Algorithmn Implementation
see:
http://www.obitko.com/tutorials/genetic-algorithms/ga-basic-description.php
"""
import random
class GeneticAlgorithm(object):
def __init__(self, genetics):
self.genetics = genetics
pass