Skip to content

Instantly share code, notes, and snippets.

View jrabary's full-sized avatar

Jaonary Rabarisoa jrabary

View GitHub Profile
@jrabary
jrabary / DDPG.py
Created July 19, 2017 20:01 — forked from kkweon/DDPG.py
Continuous control with deep reinforcement learning (DDPG) https://arxiv.org/abs/1509.02971
"""
Deep Deterministic Policy Gradients (DDPG)
https://arxiv.org/pdf/1509.02971.pdf
TODO: Batch Normalization Bug
"""
import argparse
import random
import numpy as np
import gym
import numpy as np
import theano
import theano.tensor as T
from theano import ifelse
from .. import init
from .. import nonlinearities
from .base import Layer
@jrabary
jrabary / per_class_sampler.py
Last active October 27, 2015 09:48
Fuel Transformer that samples data per target
class PerClassSampler(Transformer):
def __init__(self, data_stream, class_per_batch, sample_per_class, **kwargs):
super(PerClassSampler, self).__init__(data_stream=data_stream, produces_examples=False, **kwargs)
self.class_per_batch = class_per_batch
self.sample_per_class = sample_per_class
self.total_sample_per_target = self.__total_sample_per_target__(data_stream)
def get_data(self, request=None):
@jrabary
jrabary / index.js
Created June 12, 2015 15:56
Scatter with image tooltip
var d3 = require('d3');
require('d3-multiaxis-zoom')(d3);
var inherits = require('inherits');
var utils = require('lightning-client-utils');
var _ = require('lodash');
var colorbrewer = require('colorbrewer');
var TooltipPlugin = require('d3-tip');
TooltipPlugin(d3);
@jrabary
jrabary / CartesianTest.scala
Created April 3, 2014 12:42
RDD cartesian need cached data illustration
object CartesianTest {
case class DataFormat(id: Long, view: String, value: Array[Double])
def randomSplit(
input: RDD[DataFormat],
numFolds: Int,
trainingFraction: Double,
query: String,
target: String,
import play.api.mvc._
trait CorsSupport { self: Controller =>
def CorsAction(cb: => Result): Action[AnyContent] =
Action(cb.withHeaders(actionCorsHeaders: _*))
def CorsAction(cb: Request[AnyContent] => Result): Action[AnyContent] =
Action { request =>
cb(request).withHeaders(actionCorsHeaders: _*)
package json
import reactivemongo.bson._
import reactivemongo.bson.handlers.DefaultBSONHandlers._
import play.api.libs.json._
import play.api.libs.json.Json._
import play.api.libs.json.util._
import play.api.libs.json.Writes._
import play.api.libs.functional.syntax._
# First attempting to use Capybara directly, you will ran into issues when trying to set HTTP header.
# Using Basic HTTP Authentication requires that we needed to set the header.
# Also we need to set the Content-Type and Accept headers to ensure that Rails handles the input and output correctly.
# When using Rack, Capybara delegates request and response handling down to Rack::Test.
# So I used Rack::Test directly in my step definitions, and it works.
# Rack::Test has a module called Rack::Test::Methods that can be mixed into a class to provide it
# with methods for get, post, put, delete as well as last_request, last_response, header and more.
# I mixed Rack::Test::Methods into the Cucumber world at the top of our API steps file like so:
##############################
#
# blob : Object from MongoDB
#
# blob.body: Buffer
# blob.size: length of buffer, substitute for blob.body.length
# blob.type: MIME (Eg. audio/x-wav)
#
# req : Object from http
# res : Object from http
# _ : Object from underscore
@jrabary
jrabary / Gitlab.md
Created December 3, 2012 16:24
Configuracion de gitlab

Platform requirements:

The project is designed for the Linux operating system.

It may work on FreeBSD and Mac OS, but we don't test our application for these systems and can't guarantee stability and full functionality.

We officially support (recent versions of) these Linux distributions:

  • Ubuntu Linux
  • Debian/GNU Linux