text stringlengths 0 1.05M | meta dict |
|---|---|
__author__ = 'Tom'
import pickle
import urllib2
import os
import pymel.core as pm
import project_data as prj
reload(prj)
class updater():
def __init__(self):
self.master_url = 'https://raw.githubusercontent.com/tb-animator/tbtools/master/'
self.realPath = os.path.realpath(__file__)
self.ba... | {
"repo_name": "tb-animator/tbtools",
"path": "updater.py",
"copies": "1",
"size": "5495",
"license": "mit",
"hash": 5233507628652847000,
"line_mean": 31.5147928994,
"line_max": 123,
"alpha_frac": 0.5770700637,
"autogenerated": false,
"ratio": 3.761122518822724,
"config_test": false,
"has_no_k... |
__author__ = 'Tom'
import pymel.core as pm
import tb_messages as tb_msg
def intEntered(name, *args):
pm.optionVar(intValue=(str(name), args[0]))
class folder_picker():
def __init__(self):
self.main_layout = pm.formLayout()
self.layout = pm.rowLayout(numberOfColumns=3,
... | {
"repo_name": "tb-animator/tbtools",
"path": "apps/tb_UI.py",
"copies": "1",
"size": "15183",
"license": "mit",
"hash": -8196623118513463000,
"line_mean": 37.2443324937,
"line_max": 116,
"alpha_frac": 0.4832378318,
"autogenerated": false,
"ratio": 4.456413266803639,
"config_test": false,
"has... |
__author__ = 'tom'
from asyncore import file_dispatcher, loop
from threading import Thread
try:
from evdev import InputDevice, list_devices, ecodes
except ImportError:
print 'Not importing evdev, expected during sphinx generation on OSX'
class SixAxisResource:
"""
Resource class which will automatic... | {
"repo_name": "BaseBot/Triangula",
"path": "src/python/triangula/input.py",
"copies": "1",
"size": "18702",
"license": "apache-2.0",
"hash": 1864734521680095700,
"line_mean": 42.5944055944,
"line_max": 121,
"alpha_frac": 0.5871029836,
"autogenerated": false,
"ratio": 4.351326198231735,
"config_... |
__author__ = 'Tom'
from mock import MagicMock, patch
from test import testutils
from pnc_cli import products
from pnc_cli.swagger_client import ProductRest
def test_create_product_object():
compare = ProductRest()
compare.name = 'test-product'
compare.description = 'description'
result = products._cr... | {
"repo_name": "jianajavier/pnc-cli",
"path": "test/unit/test_products.py",
"copies": "1",
"size": "6843",
"license": "apache-2.0",
"hash": 7695010768377668000,
"line_mean": 39.2529411765,
"line_max": 103,
"alpha_frac": 0.7325734327,
"autogenerated": false,
"ratio": 3.126084970306076,
"config_te... |
__author__ = 'Tom'
from mock import MagicMock, patch
from pnc_cli import products
from pnc_cli.swagger_client import ProductRest
from pnc_cli.swagger_client import ProductsApi
def test_create_product_object():
compare = ProductRest()
compare.name = 'test-product'
compare.description = 'description'
... | {
"repo_name": "thauser/pnc-cli",
"path": "test/unit/test_products.py",
"copies": "1",
"size": "3841",
"license": "apache-2.0",
"hash": 5333895565511114000,
"line_mean": 45.8414634146,
"line_max": 103,
"alpha_frac": 0.7380890393,
"autogenerated": false,
"ratio": 3.184908789386401,
"config_test":... |
__author__ = 'tom'
from setuptools import setup, find_namespace_packages
# To build for local development use 'python setup.py develop'.
# To upload a version to pypi use 'python setup.py clean sdist upload'.
# Docs are built with 'make html' in the docs directory parallel to this one
setup(
name='approxeng.input... | {
"repo_name": "ApproxEng/approxeng.input",
"path": "src/python/setup.py",
"copies": "1",
"size": "1550",
"license": "apache-2.0",
"hash": -259787752310426270,
"line_mean": 52.4482758621,
"line_max": 128,
"alpha_frac": 0.6516129032,
"autogenerated": false,
"ratio": 3.8366336633663365,
"config_te... |
__author__ = 'tom'
from time import sleep
import RPi.GPIO as gpio
class Feather:
"""
Class used to access facilities on the ATMega328 based Feather board on the brain module. See the
'src/arduino/feather' code for what's going to be listening to messages from here. This class wraps any calls
to i2c... | {
"repo_name": "ApproxEng/viridia",
"path": "src/python/approxeng/viridia/feather.py",
"copies": "1",
"size": "3001",
"license": "apache-2.0",
"hash": 1563240729652038700,
"line_mean": 33.1022727273,
"line_max": 119,
"alpha_frac": 0.5981339553,
"autogenerated": false,
"ratio": 3.8772609819121446,
... |
__author__ = 'tom'
from time import sleep
try:
import smbus
except ImportError:
print 'Not importing smbus, expected during sphinx generation on OSX'
ARDUINO_ADDRESS = 0x70
I2C_RETRIES = 30
I2C_DELAY = 0.01
def float_to_byte(f):
"""
Map a float from -1.0 to 1.0 onto the range 0-255 and return as a... | {
"repo_name": "BaseBot/Triangula",
"path": "src/python/triangula/arduino.py",
"copies": "1",
"size": "7528",
"license": "apache-2.0",
"hash": -5079417274989429000,
"line_mean": 36.4527363184,
"line_max": 120,
"alpha_frac": 0.6149043571,
"autogenerated": false,
"ratio": 4.032137118371719,
"confi... |
__author__ = 'tom'
import cherrypy
import simplejson
from pycoin.key.validate import is_address_valid
def json_in():
if cherrypy.request.method in ["POST", "PUT"] and cherrypy.request.headers['content-type'].lower() == "application/json":
json_string = cherrypy.request.body.read()
cherrypy.request.string = json... | {
"repo_name": "bit-oasis/sniffer",
"path": "sniffer/api.py",
"copies": "1",
"size": "1763",
"license": "bsd-2-clause",
"hash": 6965492880814328000,
"line_mean": 31.6666666667,
"line_max": 159,
"alpha_frac": 0.6931366988,
"autogenerated": false,
"ratio": 3.3903846153846153,
"config_test": false,... |
__author__ = 'tom'
class Motors:
"""
Handles the mechaduino servo motors over I2C
"""
def __init__(self, i2c, base_address=0x61, motor_count=3):
"""
Create a new instance, using the supplied :class:approxeng.pi2arduino.I2CHelper to manage communication
:param i2c:
... | {
"repo_name": "ApproxEng/viridia",
"path": "src/python/approxeng/viridia/motors.py",
"copies": "1",
"size": "2855",
"license": "apache-2.0",
"hash": -5105711815883928000,
"line_mean": 37.0666666667,
"line_max": 111,
"alpha_frac": 0.6154115587,
"autogenerated": false,
"ratio": 4.078571428571428,
... |
__author__ = 'Tom Oinn'
import sys
import getopt
# Get ezdxf with 'pip install ezdxf', tested with Python2.7
import ezdxf
def mirror_coord(c):
"""
If Z coordinate of c is less than zero, return mirrored around Y axis
:param c:
a coordinate (x,y,z)
:returns:
A flattened (Z set to 0) ... | {
"repo_name": "BaseBot/Triangula",
"path": "tools/convert_onshape_dxf.py",
"copies": "1",
"size": "2008",
"license": "apache-2.0",
"hash": -5520958314281335000,
"line_mean": 25.7733333333,
"line_max": 92,
"alpha_frac": 0.5557768924,
"autogenerated": false,
"ratio": 3.2334943639291467,
"config_t... |
import itertools
def all_subsets(iterable):
for subset_size in xrange(1,len(iterable)+1):
for combination in itertools.combinations(iterable, subset_size):
yield combination
for _ in range(input()):
N = input()
numbers = map(int, raw_input().split(" "))
numbers.sort()
if numbe... | {
"repo_name": "tompauwaert/hackerrank",
"path": "warmup/sherlock-and-gcd/python/code.py",
"copies": "1",
"size": "1252",
"license": "mit",
"hash": 7868202427368889000,
"line_mean": 27.4545454545,
"line_max": 73,
"alpha_frac": 0.535942492,
"autogenerated": false,
"ratio": 3.8641975308641974,
"co... |
# lenghts of strings of 3's and 5's, in their respective multiples of_
_5_in_mult_of_3 = [3 * x for x in range(0, 100000/3 + 1)]
_3_in_mult_of_5 = [5 * x for x in range(0, 100000/5 + 1)]
def build_string(index_mult_of_3, index_mult_of_5):
result = ["5" for x in range(0, _5_in_mult_of_3[index_mult_of_3])]
resu... | {
"repo_name": "tompauwaert/hackerrank",
"path": "warmup/sherlock-and-the-beast/python/code.py",
"copies": "1",
"size": "1630",
"license": "mit",
"hash": 5267708878710160000,
"line_mean": 29.7547169811,
"line_max": 85,
"alpha_frac": 0.4993865031,
"autogenerated": false,
"ratio": 2.9744525547445257... |
__author__ = 'Tom Schaul and Thomas Rueckstiess'
from itertools import chain
import logging
from sys import exit as errorexit
from pybrain.structure.networks.feedforward import FeedForwardNetwork
from pybrain.structure.networks.recurrent import RecurrentNetwork
from pybrain.structure.modules import BiasUnit, SigmoidL... | {
"repo_name": "chanderbgoel/pybrain",
"path": "pybrain/tools/shortcuts.py",
"copies": "25",
"size": "6097",
"license": "bsd-3-clause",
"hash": -7738744973449409000,
"line_mean": 35.9515151515,
"line_max": 98,
"alpha_frac": 0.6453993767,
"autogenerated": false,
"ratio": 4.133559322033898,
"confi... |
__author__ = 'Tom Schaul and Thomas Rueckstiess'
from itertools import chain
import logging
from sys import exit as errorexit
from pybrain.structure.networks.feedforward import FeedForwardNetwork
from pybrain.structure.networks.recurrent import RecurrentNetwork
from pybrain.structure.modules import BiasUnit, Sigmoid... | {
"repo_name": "daanwierstra/pybrain",
"path": "pybrain/tools/shortcuts.py",
"copies": "1",
"size": "5979",
"license": "bsd-3-clause",
"hash": 4141533535676893700,
"line_mean": 36.1366459627,
"line_max": 98,
"alpha_frac": 0.6377320622,
"autogenerated": false,
"ratio": 4.20464135021097,
"config_t... |
__author__ = 'Tom Schaul, Sun Yi, Tobias Glasmachers'
from pybrain.tools.rankingfunctions import HansenRanking
from pybrain.optimization.distributionbased.distributionbased import DistributionBasedOptimizer
from pybrain.auxiliary.importancemixing import importanceMixing
from scipy.linalg import expm2
from scipy impor... | {
"repo_name": "abhishekgahlot/pybrain",
"path": "pybrain/optimization/distributionbased/xnes.py",
"copies": "5",
"size": "5774",
"license": "bsd-3-clause",
"hash": -9131628723300356000,
"line_mean": 39.0972222222,
"line_max": 123,
"alpha_frac": 0.6392448909,
"autogenerated": false,
"ratio": 3.781... |
__author__ = 'Tom Schaul, Tobias Glasmachers'
from scipy import dot, array, randn, exp, floor, log, sqrt, ones, multiply, log2
from pybrain.tools.rankingfunctions import HansenRanking
from pybrain.optimization.distributionbased.distributionbased import DistributionBasedOptimizer
class Rank1NES(DistributionBasedO... | {
"repo_name": "fxsjy/pybrain",
"path": "pybrain/optimization/distributionbased/rank1.py",
"copies": "2",
"size": "6937",
"license": "bsd-3-clause",
"hash": 8433125731212670000,
"line_mean": 36.3010752688,
"line_max": 131,
"alpha_frac": 0.5617702177,
"autogenerated": false,
"ratio": 3.930311614730... |
__author__ = 'Tom Schaul, tom@idsia.ch, and Daan Wierstra'
from multimodal import MultiModalFunction
from scipy import sqrt, tile, swapaxes, ravel, eye, randn
import scipy
class LennardJones(MultiModalFunction):
""" The classical atom configuration problem. The problem dimension must be a multiple of 3, and th... | {
"repo_name": "fxsjy/pybrain",
"path": "pybrain/rl/environments/functions/lennardjones.py",
"copies": "5",
"size": "3393",
"license": "bsd-3-clause",
"hash": 6839215548739690000,
"line_mean": 34.7157894737,
"line_max": 126,
"alpha_frac": 0.5543766578,
"autogenerated": false,
"ratio": 2.6822134387... |
__author__ = 'Tom Schaul, tom@idsia.ch, and Daan Wierstra'
from pybrain.rl.environments.functions.multimodal import MultiModalFunction
from scipy import sqrt, tile, swapaxes, ravel, eye, randn
import scipy
class LennardJones(MultiModalFunction):
""" The classical atom configuration problem. The problem dimensi... | {
"repo_name": "garyfeng/pybrain",
"path": "pybrain/rl/environments/functions/lennardjones.py",
"copies": "25",
"size": "3429",
"license": "bsd-3-clause",
"hash": -5101675628138401000,
"line_mean": 35.0947368421,
"line_max": 126,
"alpha_frac": 0.5573053368,
"autogenerated": false,
"ratio": 2.69152... |
__author__ = 'Tom Schaul, tom@idsia.ch and Daan Wiertra, daan@idsia.ch'
from scipy import zeros, array, mean, randn, exp, dot, argmax
from learner import Learner
from pybrain.datasets import ReinforcementDataSet, ImportanceDataSet, SequentialDataSet
from pybrain.supervised import BackpropTrainer
from pybrain.utilitie... | {
"repo_name": "daanwierstra/pybrain",
"path": "pybrain/rl/learners/rwr.py",
"copies": "1",
"size": "9200",
"license": "bsd-3-clause",
"hash": -8874547385371641000,
"line_mean": 35.8,
"line_max": 100,
"alpha_frac": 0.5229347826,
"autogenerated": false,
"ratio": 4.061810154525387,
"config_test": ... |
__author__ = 'Tom Schaul, tom@idsia.ch and Daan Wiertra, daan@idsia.ch'
from scipy import zeros, array, mean, randn, exp, dot, argmax
from pybrain.datasets import ReinforcementDataSet, ImportanceDataSet, SequentialDataSet
from pybrain.supervised import BackpropTrainer
from pybrain.utilities import drawIndex
from pybr... | {
"repo_name": "rbalda/neural_ocr",
"path": "env/lib/python2.7/site-packages/pybrain/rl/learners/directsearch/rwr.py",
"copies": "1",
"size": "9259",
"license": "mit",
"hash": 7729735537073755000,
"line_mean": 35.8884462151,
"line_max": 99,
"alpha_frac": 0.5258667243,
"autogenerated": false,
"rati... |
__author__ = 'Tom Schaul, tom@idsia.ch'
from scipy import (array, exp, tanh, clip, log, dot, sqrt, power, pi, tan,
diag, rand, real_if_close)
from scipy.linalg import inv, det, svd, logm, expm2
def semilinear(x):
""" This function ensures that the values of the array are always positive.
... | {
"repo_name": "pybrain2/pybrain2",
"path": "pybrain/tools/functions.py",
"copies": "2",
"size": "4796",
"license": "bsd-3-clause",
"hash": 7688188554428872000,
"line_mean": 28.6049382716,
"line_max": 107,
"alpha_frac": 0.5736030025,
"autogenerated": false,
"ratio": 3.411095305832148,
"config_te... |
__author__ = 'Tom Schaul, tom@idsia.ch'
from capturetask import CaptureGameTask
from pybrain.rl.agents.capturegameplayers.captureplayer import CapturePlayer
from pybrain.rl.agents.capturegameplayers import ModuleDecidingPlayer
from pybrain.rl.environments.twoplayergames.capturegame import CaptureGame
# TODO: parametr... | {
"repo_name": "daanwierstra/pybrain",
"path": "pybrain/rl/tasks/capturegame/handicaptask.py",
"copies": "1",
"size": "4812",
"license": "bsd-3-clause",
"hash": -8772712654392394000,
"line_mean": 36.8976377953,
"line_max": 106,
"alpha_frac": 0.5793848712,
"autogenerated": false,
"ratio": 3.4273504... |
__author__ = 'Tom Schaul, tom@idsia.ch'
from capturetask import CaptureGameTask
from pybrain.rl.agents.capturegameplayers import ModuleDecidingPlayer
from pybrain.rl.environments.twoplayergames import CaptureGame
from pybrain.rl.agents.capturegameplayers.captureplayer import CapturePlayer
from pybrain.structure.networ... | {
"repo_name": "daanwierstra/pybrain",
"path": "pybrain/rl/tasks/capturegame/relativetask.py",
"copies": "1",
"size": "5839",
"license": "bsd-3-clause",
"hash": 26165733899560588,
"line_mean": 34.3939393939,
"line_max": 105,
"alpha_frac": 0.5649940058,
"autogenerated": false,
"ratio": 3.8900732844... |
__author__ = 'Tom Schaul, tom@idsia.ch'
from capturetask import CaptureGameTask
from pybrain.rl.environments.twoplayergames.capturegameplayers.captureplayer import CapturePlayer
from pybrain.rl.environments.twoplayergames.capturegameplayers import ModuleDecidingPlayer
from pybrain.rl.environments.twoplayergames.captur... | {
"repo_name": "hassaanm/stock-trading",
"path": "pybrain-pybrain-87c7ac3/pybrain/rl/environments/twoplayergames/tasks/handicaptask.py",
"copies": "5",
"size": "4785",
"license": "apache-2.0",
"hash": -4205883532268829000,
"line_mean": 36.6771653543,
"line_max": 109,
"alpha_frac": 0.5945663532,
"aut... |
__author__ = 'Tom Schaul, tom@idsia.ch'
from capturetask import CaptureGameTask
from pybrain.rl.environments.twoplayergames.capturegameplayers import ModuleDecidingPlayer
from pybrain.rl.environments.twoplayergames import CaptureGame
from pybrain.rl.environments.twoplayergames.capturegameplayers.captureplayer import C... | {
"repo_name": "rbalda/neural_ocr",
"path": "env/lib/python2.7/site-packages/pybrain/rl/environments/twoplayergames/tasks/relativetask.py",
"copies": "3",
"size": "5895",
"license": "mit",
"hash": 2680978203513311700,
"line_mean": 34.5120481928,
"line_max": 105,
"alpha_frac": 0.5664122137,
"autogene... |
__author__ = 'Tom Schaul, tom@idsia.ch'
from cartpole import CartPoleEnvironment
from pybrain.rl.environments import Environment
class DoublePoleEnvironment(Environment):
""" two poles to be balanced from the same cart. """
indim = 1
ooutdim = 6
def __init__(self):
self.p1 = CartPoleEnviron... | {
"repo_name": "hassaanm/stock-trading",
"path": "src/pybrain/rl/environments/cartpole/doublepole.py",
"copies": "6",
"size": "1794",
"license": "apache-2.0",
"hash": 4353333167801628700,
"line_mean": 32.8490566038,
"line_max": 106,
"alpha_frac": 0.6120401338,
"autogenerated": false,
"ratio": 3.50... |
__author__ = 'Tom Schaul, tom@idsia.ch'
from .cartpole import CartPoleEnvironment
from pybrain.rl.environments import Environment
class DoublePoleEnvironment(Environment):
""" two poles to be balanced from the same cart. """
indim = 1
ooutdim = 6
def __init__(self):
self.p1 = CartPoleEnviro... | {
"repo_name": "pybrain/pybrain",
"path": "pybrain/rl/environments/cartpole/doublepole.py",
"copies": "25",
"size": "1795",
"license": "bsd-3-clause",
"hash": -7079691031914618000,
"line_mean": 32.8679245283,
"line_max": 106,
"alpha_frac": 0.6116991643,
"autogenerated": false,
"ratio": 3.499025341... |
__author__ = 'Tom Schaul, tom@idsia.ch'
from cartpole import CartPoleEnvironment
from pybrain.rl.environments import Environment
class DoublePoleEnvironment(Environment):
""" two poles to be balanced from the same cart. """
indim = 1
ooutdim = 6
def __init__(self):
self.p1 = CartPoleEnviron... | {
"repo_name": "rbalda/neural_ocr",
"path": "env/lib/python2.7/site-packages/pybrain/rl/environments/cartpole/doublepole.py",
"copies": "3",
"size": "1859",
"license": "mit",
"hash": 6527480171229865000,
"line_mean": 34.0754716981,
"line_max": 106,
"alpha_frac": 0.5906401291,
"autogenerated": false,... |
__author__ = 'Tom Schaul, tom@idsia.ch'
from coevolution import Coevolution
class CompetitiveCoevolution(Coevolution):
""" Coevolution with 2 independent populations, and competitive fitness sharing. """
def __str__(self):
return 'Competitive'+Coevolution.__str__(self)
def _initPopulati... | {
"repo_name": "daanwierstra/pybrain",
"path": "pybrain/rl/learners/search/competitivecoevolution.py",
"copies": "1",
"size": "4264",
"license": "bsd-3-clause",
"hash": -4520920130256485000,
"line_mean": 33.12,
"line_max": 97,
"alpha_frac": 0.5494840525,
"autogenerated": false,
"ratio": 3.34431372... |
__author__ = 'Tom Schaul, tom@idsia.ch'
from gomokutask import GomokuTask
from pybrain.rl.agents.gomokuplayers import ModuleDecidingPlayer
from pybrain.rl.environments.twoplayergames import GomokuGame
from pybrain.rl.agents.gomokuplayers.gomokuplayer import GomokuPlayer
from pybrain.structure.networks.custom.capturega... | {
"repo_name": "daanwierstra/pybrain",
"path": "pybrain/rl/tasks/gomoku/relativetask.py",
"copies": "1",
"size": "4353",
"license": "bsd-3-clause",
"hash": -7246401190949168000,
"line_mean": 32.2366412214,
"line_max": 91,
"alpha_frac": 0.5853434413,
"autogenerated": false,
"ratio": 3.7493540051679... |
__author__ = 'Tom Schaul, tom@idsia.ch'
from inspect import isclass
from .handling import XMLHandling
from pybrain.structure.connections.shared import SharedConnection
from pybrain.structure.networks.network import Network
from pybrain.structure.networks.recurrent import RecurrentNetwork
from pybrain.utilities import... | {
"repo_name": "luigift/pybrain",
"path": "pybrain/tools/customxml/networkwriter.py",
"copies": "25",
"size": "4150",
"license": "bsd-3-clause",
"hash": -6908377940070294000,
"line_mean": 36.3873873874,
"line_max": 71,
"alpha_frac": 0.6096385542,
"autogenerated": false,
"ratio": 3.9827255278310942... |
__author__ = 'Tom Schaul, tom@idsia.ch'
from learner import Learner
from policygradients import ENAC
from pybrain.rl.tasks.episodic import EpisodicTask
from pybrain.structure.modules.module import Module
from pybrain.rl.agents.policygradient import PolicyGradientAgent
class EpisodicRL(Learner):
""" Learner inter... | {
"repo_name": "daanwierstra/pybrain",
"path": "pybrain/rl/learners/episodicrl.py",
"copies": "1",
"size": "2252",
"license": "bsd-3-clause",
"hash": 1398330308170423300,
"line_mean": 38.5263157895,
"line_max": 99,
"alpha_frac": 0.6327708703,
"autogenerated": false,
"ratio": 4.124542124542124,
"... |
__author__ = 'Tom Schaul, tom@idsia.ch'
from memetic import MemeticSearch
from pybrain.rl.learners.search.es import ES
class InnerMemeticSearch(MemeticSearch, ES):
""" Population-based memetic search """
mu = 5
lambada = 5
def __init__(self, *args, **kwargs):
MemeticSearch.__init__(... | {
"repo_name": "daanwierstra/pybrain",
"path": "pybrain/rl/learners/meta/innermemetic.py",
"copies": "1",
"size": "2345",
"license": "bsd-3-clause",
"hash": 1684132064133597200,
"line_mean": 37.4590163934,
"line_max": 95,
"alpha_frac": 0.552238806,
"autogenerated": false,
"ratio": 3.99488926746166... |
__author__ = 'Tom Schaul, tom@idsia.ch'
from os import unlink, getcwd
import os.path
import profile
import pstats
import tempfile
from scipy import randn, zeros
from pybrain.structure.networks.network import Network
from pybrain.datasets import SequentialDataSet, SupervisedDataSet
from pybrain.supervised import Back... | {
"repo_name": "arnaudsj/pybrain",
"path": "pybrain/tests/helpers.py",
"copies": "5",
"size": "4402",
"license": "bsd-3-clause",
"hash": -5985613545443722000,
"line_mean": 28.9455782313,
"line_max": 102,
"alpha_frac": 0.6176737846,
"autogenerated": false,
"ratio": 3.8784140969162997,
"config_tes... |
__author__ = 'Tom Schaul, tom@idsia.ch'
from pybrain.optimization.optimizer import BlackBoxOptimizer
from scipy import exp
from random import random
class HillClimber(BlackBoxOptimizer):
""" The simplest kind of stochastic search: hill-climbing in the fitness landscape. """
evaluatorIsNoisy = False
def... | {
"repo_name": "tmeits/pybrain",
"path": "pybrain/optimization/hillclimber.py",
"copies": "31",
"size": "2118",
"license": "bsd-3-clause",
"hash": 3838290317551659500,
"line_mean": 34.8983050847,
"line_max": 91,
"alpha_frac": 0.6803588291,
"autogenerated": false,
"ratio": 4.041984732824427,
"con... |
__author__ = 'Tom Schaul, tom@idsia.ch'
from pybrain.optimization.optimizer import BlackBoxOptimizer, TopologyOptimizer
from pybrain.optimization.hillclimber import HillClimber
from pybrain.structure.evolvables.maskedparameters import MaskedParameters
class MemeticSearch(HillClimber, TopologyOptimizer):
""" Inte... | {
"repo_name": "hassaanm/stock-trading",
"path": "pybrain-pybrain-87c7ac3/pybrain/optimization/memetic/memetic.py",
"copies": "5",
"size": "2448",
"license": "apache-2.0",
"hash": 5253441243489816000,
"line_mean": 39.8,
"line_max": 120,
"alpha_frac": 0.589869281,
"autogenerated": false,
"ratio": 4... |
__author__ = 'Tom Schaul, tom@idsia.ch'
from pybrain.optimization.optimizer import ContinuousOptimizer
class DistributionBasedOptimizer(ContinuousOptimizer):
""" The parent class for all optimization algorithms that are based on
iteratively updating a search distribution.
Provides a number of pote... | {
"repo_name": "rbalda/neural_ocr",
"path": "env/lib/python2.7/site-packages/pybrain/optimization/distributionbased/distributionbased.py",
"copies": "1",
"size": "1049",
"license": "mit",
"hash": -7645390919538222000,
"line_mean": 29,
"line_max": 89,
"alpha_frac": 0.6587225929,
"autogenerated": fals... |
__author__ = 'Tom Schaul, tom@idsia.ch'
from pybrain.rl.agents.logging import LoggingAgent
from pybrain.utilities import drawIndex
from scipy import array
class LinearFA_Agent(LoggingAgent):
""" Agent class for using linear-FA RL algorithms. """
init_exploration = 0.1 # aka epsilon
explora... | {
"repo_name": "arnaudsj/pybrain",
"path": "pybrain/rl/agents/linearfa.py",
"copies": "5",
"size": "3322",
"license": "bsd-3-clause",
"hash": -5342022855814113000,
"line_mean": 37.183908046,
"line_max": 100,
"alpha_frac": 0.5960264901,
"autogenerated": false,
"ratio": 4.194444444444445,
"config_... |
__author__ = 'Tom Schaul, tom@idsia.ch'
from pybrain.rl.environments.episodic import EpisodicTask
from inspect import isclass
from pybrain.utilities import Named
from pybrain.rl.environments.twoplayergames import CaptureGame
from pybrain.rl.environments.twoplayergames.capturegameplayers import RandomCapturePlayer, Mo... | {
"repo_name": "rbalda/neural_ocr",
"path": "env/lib/python2.7/site-packages/pybrain/rl/environments/twoplayergames/tasks/capturetask.py",
"copies": "3",
"size": "3946",
"license": "mit",
"hash": -1685479334620119000,
"line_mean": 37.3106796117,
"line_max": 111,
"alpha_frac": 0.6153066396,
"autogene... |
__author__ = 'Tom Schaul, tom@idsia.ch'
from pybrain.rl.environments.episodic import EpisodicTask
from scipy import array
from random import randint, random
class XORTask(EpisodicTask):
""" Continuous task, producing binary observations, taking a single, binary action
rewarding the agent whenever action = xo... | {
"repo_name": "Neural-Network/TicTacToe",
"path": "pybrain/rl/environments/classic/xor.py",
"copies": "26",
"size": "2292",
"license": "bsd-3-clause",
"hash": 5306373466801897000,
"line_mean": 28.0253164557,
"line_max": 86,
"alpha_frac": 0.547556719,
"autogenerated": false,
"ratio": 3.75737704918... |
__author__ = 'Tom Schaul, tom@idsia.ch'
from pybrain.rl.environments.twoplayergames.gomoku import GomokuGame
class PenteGame(GomokuGame):
""" The game of Pente.
The rules are similar to Go-Moku, except that it is now possible to capture
stones, in pairs, by putting stones at both ends of a pair of the o... | {
"repo_name": "Adai0808/pybrain",
"path": "pybrain/rl/environments/twoplayergames/pente.py",
"copies": "25",
"size": "3230",
"license": "bsd-3-clause",
"hash": 5305270173914281000,
"line_mean": 36.1264367816,
"line_max": 128,
"alpha_frac": 0.5009287926,
"autogenerated": false,
"ratio": 3.49945828... |
__author__ = 'Tom Schaul, tom@idsia.ch'
from pybrain.rl.environments.twoplayergames.gomoku import GomokuGame
class PenteGame(GomokuGame):
""" The game of Pente.
The rules are similar to Go-Moku, except that it is now possible to capture
stones, in pairs, by putting stones at both ends of a pair of ... | {
"repo_name": "daanwierstra/pybrain",
"path": "pybrain/rl/environments/twoplayergames/pente.py",
"copies": "1",
"size": "3290",
"license": "bsd-3-clause",
"hash": 3911984196297935400,
"line_mean": 36.8275862069,
"line_max": 120,
"alpha_frac": 0.4917933131,
"autogenerated": false,
"ratio": 3.58387... |
__author__ = 'Tom Schaul, tom@idsia.ch'
from pybrain.rl.environments.twoplayergames.twoplayergame import TwoPlayerGame
from pybrain.utilities import Named
class Tournament(Named):
""" the tournament class is a specific kind of experiment, that takes a pool of agents
and has them compete against each other in... | {
"repo_name": "pybrain/pybrain",
"path": "pybrain/rl/experiments/tournament.py",
"copies": "25",
"size": "4173",
"license": "bsd-3-clause",
"hash": -1399032627441814800,
"line_mean": 34.6666666667,
"line_max": 128,
"alpha_frac": 0.507788162,
"autogenerated": false,
"ratio": 3.790190735694823,
"... |
__author__ = 'Tom Schaul, tom@idsia.ch'
from pybrain.rl import EpisodicTask
from inspect import isclass
from pybrain.utilities import Named
from pybrain.rl.environments.twoplayergames import CaptureGame
from pybrain.rl.agents.capturegameplayers import RandomCapturePlayer, ModuleDecidingPlayer
from pybrain.rl.agents.c... | {
"repo_name": "daanwierstra/pybrain",
"path": "pybrain/rl/tasks/capturegame/capturetask.py",
"copies": "1",
"size": "3882",
"license": "bsd-3-clause",
"hash": -8304437835351581000,
"line_mean": 36.6893203883,
"line_max": 111,
"alpha_frac": 0.609994848,
"autogenerated": false,
"ratio": 4.214983713... |
__author__ = 'Tom Schaul, tom@idsia.ch'
from pybrain.rl import EpisodicTask
from inspect import isclass
from pybrain.utilities import Named
from pybrain.rl.environments.twoplayergames import GomokuGame
from pybrain.rl.agents.gomokuplayers import RandomGomokuPlayer, ModuleDecidingPlayer
from pybrain.rl.agents.gomokupl... | {
"repo_name": "daanwierstra/pybrain",
"path": "pybrain/rl/tasks/gomoku/gomokutask.py",
"copies": "1",
"size": "3885",
"license": "bsd-3-clause",
"hash": 7173602859754377000,
"line_mean": 37.0882352941,
"line_max": 111,
"alpha_frac": 0.6066924067,
"autogenerated": false,
"ratio": 4.055323590814196... |
__author__ = 'Tom Schaul, tom@idsia.ch'
from pybrain.rl.learners import Learner
from pybrain.structure.modules.module import Module
from pybrain.structure.evolvables.maskedparameters import MaskedParameters
from pybrain.structure.evolvables.maskedmodule import MaskedModule
from pybrain.structure.evolvables.topology im... | {
"repo_name": "daanwierstra/pybrain",
"path": "pybrain/rl/learners/search/weightguessing.py",
"copies": "1",
"size": "1149",
"license": "bsd-3-clause",
"hash": -7616349196721730000,
"line_mean": 33.8484848485,
"line_max": 74,
"alpha_frac": 0.6736292428,
"autogenerated": false,
"ratio": 3.86868686... |
__author__ = 'Tom Schaul, tom@idsia.ch'
from pybrain.structure.evolvables.evolvable import Evolvable
class IncrementableComplexity(Evolvable):
""" Subclasses of this have a concept of complexity of their parameter space,
and that complexity can be increased with NO disturbance on their behavior,
but afte... | {
"repo_name": "daanwierstra/pybrain",
"path": "pybrain/rl/learners/search/incrementalcomplexity/incrementablecomplexity.py",
"copies": "1",
"size": "1081",
"license": "bsd-3-clause",
"hash": -6836212841143151000,
"line_mean": 35.0666666667,
"line_max": 84,
"alpha_frac": 0.6577243293,
"autogenerated... |
__author__ = 'Tom Schaul, tom@idsia.ch'
from pybrain.structure.modules import TanhLayer, SigmoidLayer
from pybrain.structure.networks.feedforward import FeedForwardNetwork
from pybrain.structure.connections.shared import MotherConnection, SharedFullConnection
from pybrain.structure.modules.linearlayer import LinearLay... | {
"repo_name": "rbalda/neural_ocr",
"path": "env/lib/python2.7/site-packages/pybrain/structure/networks/bidirectional.py",
"copies": "1",
"size": "4158",
"license": "mit",
"hash": 3451932079358989000,
"line_mean": 43.2340425532,
"line_max": 114,
"alpha_frac": 0.6430976431,
"autogenerated": false,
... |
__author__ = 'Tom Schaul, tom@idsia.ch'
from pybrain.structure.networks.feedforward import FeedForwardNetwork
from pybrain.structure.connections.shared import MotherConnection, SharedFullConnection
from pybrain.utilities import iterCombinations
# TODO: special treatment for multi-dimensional lstm cells: identity conn... | {
"repo_name": "daanwierstra/pybrain",
"path": "pybrain/structure/networks/swiping.py",
"copies": "1",
"size": "5493",
"license": "bsd-3-clause",
"hash": 8851171464086040000,
"line_mean": 45.9572649573,
"line_max": 148,
"alpha_frac": 0.5918441653,
"autogenerated": false,
"ratio": 4.47677261613692,... |
__author__ = 'Tom Schaul, tom@idsia.ch'
from pybrain.structure.networks.swiping import SwipingNetwork
from pybrain import MDLSTMLayer, IdentityConnection
from pybrain import ModuleMesh, LinearLayer, TanhLayer, SigmoidLayer
from scipy import product
class MultiDimensionalRNN(SwipingNetwork):
""" One possible impl... | {
"repo_name": "RatulGhosh/pybrain",
"path": "pybrain/structure/networks/multidimensional.py",
"copies": "31",
"size": "2415",
"license": "bsd-3-clause",
"hash": -6260097486053753000,
"line_mean": 39.9322033898,
"line_max": 131,
"alpha_frac": 0.617805383,
"autogenerated": false,
"ratio": 3.9141004... |
__author__ = 'Tom Schaul, tom@idsia.ch'
from pybrain.structure.parametercontainer import ParameterContainer
from connection import Connection
from full import FullConnection
from subsampling import SubsamplingConnection
class OwnershipViolation(Exception):
"""Exception raised when one attempts to write-access th... | {
"repo_name": "abhishekgahlot/pybrain",
"path": "pybrain/structure/connections/shared.py",
"copies": "1",
"size": "2619",
"license": "bsd-3-clause",
"hash": 5559074863715170000,
"line_mean": 31.3333333333,
"line_max": 81,
"alpha_frac": 0.7147766323,
"autogenerated": false,
"ratio": 4.130914826498... |
__author__ = 'Tom Schaul, tom@idsia.ch'
from pybrain.structure.parametercontainer import ParameterContainer
from connection import Connection
from full import FullConnection
class OwnershipViolation(Exception):
"""Exception raised when one attempts to write-access the parameters of the
SharedConnection, inst... | {
"repo_name": "daanwierstra/pybrain",
"path": "pybrain/structure/connections/shared.py",
"copies": "1",
"size": "2012",
"license": "bsd-3-clause",
"hash": -5656212858864401000,
"line_mean": 30.4375,
"line_max": 79,
"alpha_frac": 0.6729622266,
"autogenerated": false,
"ratio": 4.25369978858351,
"... |
__author__ = 'Tom Schaul, tom@idsia.ch'
from pybrain.structure.parametercontainer import ParameterContainer
from pybrain.structure.connections.connection import Connection
from pybrain.structure.connections.full import FullConnection
from pybrain.structure.connections.subsampling import SubsamplingConnection
class O... | {
"repo_name": "comepradz/pybrain",
"path": "pybrain/structure/connections/shared.py",
"copies": "26",
"size": "2709",
"license": "bsd-3-clause",
"hash": -9116506446610333000,
"line_mean": 32.4444444444,
"line_max": 81,
"alpha_frac": 0.7209302326,
"autogenerated": false,
"ratio": 4.13587786259542,... |
__author__ = 'Tom Schaul, tom@idsia.ch'
from pybrain.structure.parametercontainer import ParameterContainer
from pybrain.structure.modules.module import Module
class CheaplyCopiable(ParameterContainer, Module):
""" a shallow version of a module, that it only copies/mutates the params, not the structure. """
... | {
"repo_name": "daanwierstra/pybrain",
"path": "pybrain/structure/evolvables/cheaplycopiable.py",
"copies": "4",
"size": "2513",
"license": "bsd-3-clause",
"hash": -2577986466688017000,
"line_mean": 29.6585365854,
"line_max": 101,
"alpha_frac": 0.583764425,
"autogenerated": false,
"ratio": 4.19532... |
__author__ = 'Tom Schaul, tom@idsia.ch'
from pybrain.utilities import abstractMethod, Named
class Learner(Named):
"""Takes as input a callable `evaluator` an object that can be evaluated
by calling it with it as an argument, with that. The result of an evaluation
is a real number, which the Learner attem... | {
"repo_name": "daanwierstra/pybrain",
"path": "pybrain/rl/learners/learner.py",
"copies": "1",
"size": "2423",
"license": "bsd-3-clause",
"hash": -1293098924816671000,
"line_mean": 37.4761904762,
"line_max": 96,
"alpha_frac": 0.6314486174,
"autogenerated": false,
"ratio": 4.554511278195489,
"co... |
__author__ = 'Tom Schaul, tom@idsia.ch'
from pybrain.utilities import abstractMethod
from evolvable import Evolvable
from pybrain.structure.parametercontainer import ParameterContainer
class TopologyEvolvable(ParameterContainer):
""" An evolvable object, with higher-level mutations,
that change the topology... | {
"repo_name": "daanwierstra/pybrain",
"path": "pybrain/structure/evolvables/topology.py",
"copies": "4",
"size": "1253",
"license": "bsd-3-clause",
"hash": -3577156976805351000,
"line_mean": 28.1627906977,
"line_max": 67,
"alpha_frac": 0.6384676776,
"autogenerated": false,
"ratio": 4.233108108108... |
__author__ = 'Tom Schaul, tom@idsia.ch'
from pybrain.utilities import abstractMethod
from pybrain.optimization.optimizer import BlackBoxOptimizer
class Evolution(BlackBoxOptimizer):
""" Base class for evolutionary algorithms, seen as function optimizers. """
populationSize = 10
storeAllPopulations = Fa... | {
"repo_name": "Ryanglambert/pybrain",
"path": "pybrain/optimization/populationbased/evolution.py",
"copies": "31",
"size": "1133",
"license": "bsd-3-clause",
"hash": -1430233598623924500,
"line_mean": 28.0769230769,
"line_max": 107,
"alpha_frac": 0.6699029126,
"autogenerated": false,
"ratio": 4.2... |
__author__ = 'Tom Schaul, tom@idsia.ch'
from pybrain.utilities import abstractMethod
from pybrain.rl.environments import Environment
class CompetitiveEnvironment(Environment):
""" an environment in which multiple agents interact, competitively.
This class is only for conceptual grouping, it only constrains ... | {
"repo_name": "rbalda/neural_ocr",
"path": "env/lib/python2.7/site-packages/pybrain/rl/environments/twoplayergames/twoplayergame.py",
"copies": "3",
"size": "1721",
"license": "mit",
"hash": -6656270352087169000,
"line_mean": 32.7647058824,
"line_max": 103,
"alpha_frac": 0.635676932,
"autogenerated... |
__author__ = 'Tom Schaul, tom@idsia.ch'
from pybrain.utilities import abstractMethod
from pybrain.structure.evolvables.evolvable import Evolvable
from pybrain.structure.parametercontainer import ParameterContainer
class TopologyEvolvable(ParameterContainer):
""" An evolvable object, with higher-level mutations,
... | {
"repo_name": "zygmuntz/pybrain",
"path": "pybrain/structure/evolvables/topology.py",
"copies": "26",
"size": "1247",
"license": "bsd-3-clause",
"hash": 3599521807195131000,
"line_mean": 28.023255814,
"line_max": 67,
"alpha_frac": 0.6623897354,
"autogenerated": false,
"ratio": 4.07516339869281,
... |
__author__ = 'Tom Schaul, tom@idsia.ch'
from pybrain.utilities import abstractMethod
from scipy import clip
class Task(object):
""" A task is associating a purpose with an environment. It decides how to evaluate the
observations, potentially returning reinforcement rewards or fitness values.
Furthermore... | {
"repo_name": "daanwierstra/pybrain",
"path": "pybrain/rl/tasks/task.py",
"copies": "1",
"size": "3358",
"license": "bsd-3-clause",
"hash": 6563611431393260000,
"line_mean": 38.9880952381,
"line_max": 116,
"alpha_frac": 0.5866587254,
"autogenerated": false,
"ratio": 4.11015911872705,
"config_te... |
__author__ = 'Tom Schaul, tom@idsia.ch'
from pybrain.utilities import abstractMethod
from task import Task
from pybrain.rl.agents.agent import Agent
from pybrain.structure.modules.module import Module
from pybrain.rl.evaluator import Evaluator
from pybrain.rl.experiments.episodic import EpisodicExperiment
from scipy i... | {
"repo_name": "daanwierstra/pybrain",
"path": "pybrain/rl/tasks/episodic.py",
"copies": "1",
"size": "2416",
"license": "bsd-3-clause",
"hash": -1689632635771256000,
"line_mean": 34.5441176471,
"line_max": 108,
"alpha_frac": 0.6270695364,
"autogenerated": false,
"ratio": 4.558490566037736,
"con... |
__author__ = 'Tom Schaul, tom@idsia.ch'
from pybrain.utilities import abstractMethod
class Environment(object):
""" The general interface for whatever we would like to model, learn about,
predict, or simply interact in. We can perform actions, and access
(partial) observations.
"""
... | {
"repo_name": "rbalda/neural_ocr",
"path": "env/lib/python2.7/site-packages/pybrain/rl/environments/environment.py",
"copies": "3",
"size": "1668",
"license": "mit",
"hash": 8832888737219046000,
"line_mean": 31.7058823529,
"line_max": 84,
"alpha_frac": 0.6223021583,
"autogenerated": false,
"ratio... |
__author__ = 'Tom Schaul, tom@idsia.ch'
from pybrain.utilities import blockCombine
from scipy import mat, dot, outer
from scipy.linalg import inv, cholesky
def calcFisherInformation(sigma, invSigma=None, factorSigma=None):
""" Compute the exact Fisher Information Matrix of a Gaussian distribution,
given its... | {
"repo_name": "jlegendary/pybrain",
"path": "pybrain/tools/fisher.py",
"copies": "25",
"size": "1662",
"license": "bsd-3-clause",
"hash": 141727783683589230,
"line_mean": 29.7777777778,
"line_max": 91,
"alpha_frac": 0.5667870036,
"autogenerated": false,
"ratio": 3.1065420560747663,
"config_test... |
__author__ = 'Tom Schaul, tom@idsia.ch'
from pybrain.utilities import iterCombinations, Named
from moduleslice import ModuleSlice
class ModuleMesh(Named):
""" An multi-dimensional array of modules, accessible by their coordinates.
All modules need to have the same indim and outdim """
def __... | {
"repo_name": "rbalda/neural_ocr",
"path": "env/lib/python2.7/site-packages/pybrain/structure/modulemesh.py",
"copies": "1",
"size": "2203",
"license": "mit",
"hash": -6069909798550724000,
"line_mean": 40.5660377358,
"line_max": 106,
"alpha_frac": 0.616432138,
"autogenerated": false,
"ratio": 4.3... |
__author__ = 'Tom Schaul, tom@idsia.ch'
from pybrain.utilities import iterCombinations, Named
from pybrain.structure.moduleslice import ModuleSlice
from functools import reduce
class ModuleMesh(Named):
""" An multi-dimensional array of modules, accessible by their coordinates.
All modules need to have the sa... | {
"repo_name": "pybrain/pybrain",
"path": "pybrain/structure/modulemesh.py",
"copies": "25",
"size": "2195",
"license": "bsd-3-clause",
"hash": 8665525480822343000,
"line_mean": 39.6481481481,
"line_max": 106,
"alpha_frac": 0.637357631,
"autogenerated": false,
"ratio": 4.229287090558767,
"config... |
__author__ = 'Tom Schaul, tom@idsia.ch'
from pybrain.utilities import Named
class ModuleSlice(Named):
""" A wrapper for using a particular input-output slice of a module's buffers.
The constructors of connections between ModuleSlices need to ensure a correct use
(i.e) do the slicing on the base module ... | {
"repo_name": "daanwierstra/pybrain",
"path": "pybrain/structure/moduleslice.py",
"copies": "1",
"size": "1757",
"license": "bsd-3-clause",
"hash": -6949877843594684000,
"line_mean": 44.0769230769,
"line_max": 101,
"alpha_frac": 0.5993170176,
"autogenerated": false,
"ratio": 3.8871681415929205,
... |
__author__ = 'Tom Schaul, tom@idsia.ch'
from pylab import figure, savefig, imshow, axes, axis, cm, show
from scipy import array, amin, amax, ndarray, reshape
from pybrain.structure.networks import Network
from pybrain.tools.customxml import NetworkReader
from pybrain.structure.parametercontainer import ParameterConta... | {
"repo_name": "cmorgan/pybrain",
"path": "pybrain/tools/plotting/colormaps.py",
"copies": "2",
"size": "4813",
"license": "bsd-3-clause",
"hash": -5411068569200700000,
"line_mean": 40.1367521368,
"line_max": 158,
"alpha_frac": 0.5807188863,
"autogenerated": false,
"ratio": 4.134879725085911,
"c... |
__author__ = 'Tom Schaul, tom@idsia.ch'
from pylab import figure, savefig, imshow, axes, axis, cm, show
from scipy import array, amin, amax
class ColorMap:
def __init__(self, mat, cmap=None, pixelspervalue=20, minvalue=None, maxvalue=None):
""" Make a colormap image of a matrix
:key mat:... | {
"repo_name": "rbalda/neural_ocr",
"path": "env/lib/python2.7/site-packages/pybrain/tools/plotting/colormaps.py",
"copies": "1",
"size": "1124",
"license": "mit",
"hash": 3628601332864537000,
"line_mean": 32.0588235294,
"line_max": 88,
"alpha_frac": 0.5631672598,
"autogenerated": false,
"ratio": ... |
__author__ = 'Tom Schaul, tom@idsia.ch'
from pylab import figure, savefig, imshow, axes, axis, cm, show #@UnresolvedImport
from scipy import array, amin, amax
class ColorMap:
def __init__(self, mat, cmap = None, pixelspervalue = 20, minvalue = None, maxvalue = None):
""" Make a colormap image of a matrix... | {
"repo_name": "daanwierstra/pybrain",
"path": "pybrain/tools/plotting/colormaps.py",
"copies": "1",
"size": "1141",
"license": "bsd-3-clause",
"hash": 406856446876540800,
"line_mean": 33.6060606061,
"line_max": 96,
"alpha_frac": 0.5705521472,
"autogenerated": false,
"ratio": 3.7166123778501627,
... |
__author__ = 'Tom Schaul, tom@idsia.ch'
from random import choice
from scipy import zeros
from twoplayergame import TwoPlayerGame
# TODO: undo operation
class CaptureGame(TwoPlayerGame):
""" the capture game is a simplified version of the Go game: the first player to capture a stone wins!
Pass moves are f... | {
"repo_name": "daanwierstra/pybrain",
"path": "pybrain/rl/environments/twoplayergames/capturegame.py",
"copies": "1",
"size": "9101",
"license": "bsd-3-clause",
"hash": -1913510715038331100,
"line_mean": 33.3471698113,
"line_max": 106,
"alpha_frac": 0.4825843314,
"autogenerated": false,
"ratio": ... |
__author__ = 'Tom Schaul, tom@idsia.ch'
from random import choice
from scipy import zeros
from .twoplayergame import TwoPlayerGame
# TODO: undo operation
class CaptureGame(TwoPlayerGame):
""" the capture game is a simplified version of the Go game: the first player to capture a stone wins!
Pass moves are ... | {
"repo_name": "comepradz/pybrain",
"path": "pybrain/rl/environments/twoplayergames/capturegame.py",
"copies": "25",
"size": "8789",
"license": "bsd-3-clause",
"hash": -4014914470676510700,
"line_mean": 32.1660377358,
"line_max": 106,
"alpha_frac": 0.4977813176,
"autogenerated": false,
"ratio": 3.... |
__author__ = 'Tom Schaul, tom@idsia.ch'
from random import choice
from coevolution import Coevolution
class MultiPopulationCoevolution(Coevolution):
""" Coevolution with a number of independent populations. """
numPops = 10
def __str__(self):
return 'MultiPop'+str(self.numPops)+Coevolu... | {
"repo_name": "daanwierstra/pybrain",
"path": "pybrain/rl/learners/search/multipopulationcoevolution.py",
"copies": "4",
"size": "2391",
"license": "bsd-3-clause",
"hash": 7015668459106035000,
"line_mean": 34.1764705882,
"line_max": 113,
"alpha_frac": 0.5516520284,
"autogenerated": false,
"ratio"... |
__author__ = 'Tom Schaul, tom@idsia.ch'
from random import choice
from pybrain.optimization.coevolution.coevolution import Coevolution
class MultiPopulationCoevolution(Coevolution):
""" Coevolution with a number of independent populations. """
numPops = 10
def __str__(self):
return 'MultiPop'+... | {
"repo_name": "jlegendary/pybrain",
"path": "pybrain/optimization/populationbased/coevolution/multipopulationcoevolution.py",
"copies": "24",
"size": "2325",
"license": "bsd-3-clause",
"hash": -3312438982213110000,
"line_mean": 33.7014925373,
"line_max": 102,
"alpha_frac": 0.5802150538,
"autogenera... |
__author__ = 'Tom Schaul, tom@idsia.ch'
from random import choice
from pybrain.optimization.populationbased.coevolution import Coevolution
class MultiPopulationCoevolution(Coevolution):
""" Coevolution with a number of independent populations. """
numPops = 10
def __str__(self):
return 'MultiP... | {
"repo_name": "cmorgan/pybrain",
"path": "pybrain/optimization/populationbased/coevolution/multipopulationcoevolution.py",
"copies": "1",
"size": "2329",
"license": "bsd-3-clause",
"hash": 7810402441667222000,
"line_mean": 33.7611940299,
"line_max": 102,
"alpha_frac": 0.580936024,
"autogenerated": ... |
__author__ = 'Tom Schaul, tom@idsia.ch'
from random import choice, random
from scipy import array
from pomdp import POMDPTask
class TigerTask(POMDPTask):
""" two doors, behind one is a tiger - we can listen or open. """
observations = 2
actions = 3
minReward = -100
discount = 0.75
# allowe... | {
"repo_name": "hassaanm/stock-trading",
"path": "src/pybrain/rl/environments/mazes/tasks/tiger.py",
"copies": "6",
"size": "1399",
"license": "apache-2.0",
"hash": -5084315537984967000,
"line_mean": 23.9821428571,
"line_max": 76,
"alpha_frac": 0.5646890636,
"autogenerated": false,
"ratio": 3.7010... |
__author__ = 'Tom Schaul, tom@idsia.ch'
from random import choice, random
from scipy import array
from .pomdp import POMDPTask
class TigerTask(POMDPTask):
""" two doors, behind one is a tiger - we can listen or open. """
observations = 2
actions = 3
minReward = -100
discount = 0.75
# allow... | {
"repo_name": "pybrain/pybrain",
"path": "pybrain/rl/environments/mazes/tasks/tiger.py",
"copies": "25",
"size": "1400",
"license": "bsd-3-clause",
"hash": -86628770394768240,
"line_mean": 24,
"line_max": 76,
"alpha_frac": 0.5642857143,
"autogenerated": false,
"ratio": 3.6939313984168867,
"conf... |
__author__ = 'Tom Schaul, tom@idsia.ch'
from random import choice, random
from scipy import array
from pomdp import POMDPTask
class TigerTask(POMDPTask):
""" two doors, behind one is a tiger - we can listen or open. """
observations = 2
actions = 3
minReward = -100
discount = 0.75
... | {
"repo_name": "rbalda/neural_ocr",
"path": "env/lib/python2.7/site-packages/pybrain/rl/environments/mazes/tasks/tiger.py",
"copies": "4",
"size": "1455",
"license": "mit",
"hash": 4449367936548671500,
"line_mean": 24.5438596491,
"line_max": 76,
"alpha_frac": 0.5429553265,
"autogenerated": false,
... |
__author__ = 'Tom Schaul, tom@idsia.ch'
from random import random, choice
from scipy import array, zeros
from maze import MazeTask
class FourByThreeMaze(MazeTask):
"""
######
# *#
# # -#
# #
######
The '-' spot if absorbing, and giving negative reward.
"""
discount = 0.95
... | {
"repo_name": "abhishekgahlot/pybrain",
"path": "pybrain/rl/environments/mazes/tasks/maze4x3.py",
"copies": "6",
"size": "1557",
"license": "bsd-3-clause",
"hash": 7742146435215192000,
"line_mean": 23.328125,
"line_max": 86,
"alpha_frac": 0.4739884393,
"autogenerated": false,
"ratio": 3.145454545... |
__author__ = 'Tom Schaul, tom@idsia.ch'
from random import random, choice
from scipy import array, zeros
from .maze import MazeTask
class FourByThreeMaze(MazeTask):
"""
######
# *#
# # -#
# #
######
The '-' spot if absorbing, and giving negative reward.
"""
discount = 0.95... | {
"repo_name": "pybrain2/pybrain2",
"path": "pybrain/rl/environments/mazes/tasks/maze4x3.py",
"copies": "25",
"size": "1558",
"license": "bsd-3-clause",
"hash": 1346300886385020700,
"line_mean": 23.34375,
"line_max": 86,
"alpha_frac": 0.4736842105,
"autogenerated": false,
"ratio": 3.14112903225806... |
__author__ = 'Tom Schaul, tom@idsia.ch'
from random import random, choice
from scipy import array, zeros
from maze import MazeTask
class FourByThreeMaze(MazeTask):
"""
######
# *#
# # -#
# #
######
The '-' spot if absorbing, and giving negative reward.
"""
discount... | {
"repo_name": "rbalda/neural_ocr",
"path": "env/lib/python2.7/site-packages/pybrain/rl/environments/mazes/tasks/maze4x3.py",
"copies": "3",
"size": "1631",
"license": "mit",
"hash": 8887716128736963000,
"line_mean": 24.484375,
"line_max": 86,
"alpha_frac": 0.4524831392,
"autogenerated": false,
"r... |
__author__ = 'Tom Schaul, tom@idsia.ch'
from random import random, choice
from scipy import zeros
from pybrain.utilities import Named
from pybrain.rl.environments.environment import Environment
# TODO: mazes can have any number of dimensions?
class Maze(Environment, Named):
""" 2D mazes, with actions being... | {
"repo_name": "daanwierstra/pybrain",
"path": "pybrain/rl/environments/mazes/maze.py",
"copies": "1",
"size": "3536",
"license": "bsd-3-clause",
"hash": -1139736382325753100,
"line_mean": 30.0175438596,
"line_max": 120,
"alpha_frac": 0.5393099548,
"autogenerated": false,
"ratio": 3.91150442477876... |
__author__ = 'Tom Schaul, tom@idsia.ch'
from random import random, randint
from scipy import zeros
from incrementablecomplexity import IncrementableComplexity
from pybrain.utilities import int2gray, gray2int
class PrecisionBoundParameters(IncrementableComplexity):
""" Every weight is encoded with a limited numb... | {
"repo_name": "daanwierstra/pybrain",
"path": "pybrain/rl/learners/search/incrementalcomplexity/precisionboundparameters.py",
"copies": "1",
"size": "1952",
"license": "bsd-3-clause",
"hash": 1347986612970910700,
"line_mean": 35.1666666667,
"line_max": 109,
"alpha_frac": 0.637807377,
"autogenerated... |
__author__ = 'Tom Schaul, tom@idsia.ch'
from random import uniform
from scipy import array
from scipy.stats.distributions import norm
def importanceMixing(oldpoints, oldpdf, newpdf, newdistr, forcedRefresh = 0.01):
""" Implements importance mixing. Given a set of points, an old and a new pdf-function for them
... | {
"repo_name": "pybrain2/pybrain2",
"path": "pybrain/auxiliary/importancemixing.py",
"copies": "31",
"size": "1713",
"license": "bsd-3-clause",
"hash": -2026663853633295600,
"line_mean": 33.28,
"line_max": 131,
"alpha_frac": 0.6310566258,
"autogenerated": false,
"ratio": 3.4536290322580645,
"con... |
__author__ = 'Tom Schaul, tom@idsia.ch'
from scipy import argmax, array
from random import sample, choice, shuffle
from pybrain.utilities import fListToString, Named
class Coevolution(Named):
""" Population-based generational evolutionary algorithm
with fitness being based (paritally) on a relative measure... | {
"repo_name": "rbalda/neural_ocr",
"path": "env/lib/python2.7/site-packages/pybrain/optimization/populationbased/coevolution/coevolution.py",
"copies": "3",
"size": "11379",
"license": "mit",
"hash": -2942122188411496400,
"line_mean": 38.1030927835,
"line_max": 115,
"alpha_frac": 0.5509271465,
"aut... |
__author__ = 'Tom Schaul, tom@idsia.ch'
from scipy import argmax, array
from pybrain.rl.learners.blackboxoptimizers import BlackBoxOptimizer
from pybrain.utilities import abstractMethod
class Evolution(BlackBoxOptimizer):
""" Base class for evolutionary algorithms, seen as function optimizers. """
maxg... | {
"repo_name": "daanwierstra/pybrain",
"path": "pybrain/rl/learners/blackboxoptimizers/evolution/evolution.py",
"copies": "1",
"size": "2334",
"license": "bsd-3-clause",
"hash": 4523660919286747000,
"line_mean": 30.5540540541,
"line_max": 115,
"alpha_frac": 0.5959725793,
"autogenerated": false,
"r... |
__author__ = 'Tom Schaul, tom@idsia.ch'
from scipy import array, exp, tanh, clip, log, dot, sqrt, power, pi, tan, diag, rand
from scipy.linalg import inv, det, svd
def semilinear(x):
""" This function ensures that the values of the array are always positive. It is
x+1 for x=>0 and exp(x) for x<0. """
... | {
"repo_name": "daanwierstra/pybrain",
"path": "pybrain/tools/functions.py",
"copies": "1",
"size": "4162",
"license": "bsd-3-clause",
"hash": 7791636833328194000,
"line_mean": 29.837037037,
"line_max": 107,
"alpha_frac": 0.5800096108,
"autogenerated": false,
"ratio": 3.383739837398374,
"config_... |
__author__ = 'Tom Schaul, tom@idsia.ch'
from scipy import array, exp, tanh, clip, log, dot, sqrt, power, pi, tan, diag, rand, real_if_close
from scipy.linalg import inv, det, svd, logm, expm2
def semilinear(x):
""" This function ensures that the values of the array are always positive. It is
x+1 for x=>0... | {
"repo_name": "comepradz/pybrain",
"path": "pybrain/tools/functions.py",
"copies": "21",
"size": "4717",
"license": "bsd-3-clause",
"hash": 2181887259316481800,
"line_mean": 29.4322580645,
"line_max": 107,
"alpha_frac": 0.5766376934,
"autogenerated": false,
"ratio": 3.4033189033189033,
"config_... |
__author__ = 'Tom Schaul, tom@idsia.ch'
from scipy import array, exp, tanh, clip, log, dot, sqrt, power, pi, tan, diag, rand, real_if_close
from scipy.linalg import inv, det, svd, logm, expm
def semilinear(x):
""" This function ensures that the values of the array are always positive. It is
x+1 for x=>0 ... | {
"repo_name": "garyfeng/pybrain",
"path": "pybrain/tools/functions.py",
"copies": "2",
"size": "4715",
"license": "bsd-3-clause",
"hash": -1249510061828316400,
"line_mean": 29.4193548387,
"line_max": 107,
"alpha_frac": 0.5764581124,
"autogenerated": false,
"ratio": 3.406791907514451,
"config_te... |
__author__ = 'Tom Schaul, tom@idsia.ch'
from scipy import array
from .pomdp import POMDPTask
from pybrain.rl.environments.mazes import Maze
from pybrain.rl.environments.task import Task
class MazeTask(POMDPTask):
""" a task corresponding to a maze environment """
bangPenalty = 0
defaultPenalty = 0
... | {
"repo_name": "jlegendary/pybrain",
"path": "pybrain/rl/environments/mazes/tasks/maze.py",
"copies": "25",
"size": "1486",
"license": "bsd-3-clause",
"hash": 2240221575033361700,
"line_mean": 22.5873015873,
"line_max": 97,
"alpha_frac": 0.5679676985,
"autogenerated": false,
"ratio": 3.40045766590... |
__author__ = 'Tom Schaul, tom@idsia.ch'
from scipy import array
from pomdp import POMDPTask
from pybrain.rl.environments.mazes import Maze
from pybrain.rl.tasks.task import Task
class MazeTask(POMDPTask):
""" a task corresponding to a maze environment """
bangPenalty = 0
defaultPenalty = 0
fina... | {
"repo_name": "daanwierstra/pybrain",
"path": "pybrain/rl/tasks/pomdp/maze.py",
"copies": "1",
"size": "1526",
"license": "bsd-3-clause",
"hash": -4630619042318852000,
"line_mean": 23.6129032258,
"line_max": 101,
"alpha_frac": 0.5484927916,
"autogenerated": false,
"ratio": 3.5161290322580645,
"... |
__author__ = 'Tom Schaul, tom@idsia.ch'
from scipy import array, randn, ndarray, isinf, isnan, isscalar
import logging
from pybrain.utilities import setAllArgs, abstractMethod, DivergenceError
from pybrain.rl.learners.directsearch.directsearch import DirectSearchLearner
from pybrain.structure.parametercontainer impor... | {
"repo_name": "abhishekgahlot/pybrain",
"path": "pybrain/optimization/optimizer.py",
"copies": "2",
"size": "15183",
"license": "bsd-3-clause",
"hash": 4693311026180826000,
"line_mean": 43.3947368421,
"line_max": 127,
"alpha_frac": 0.610814727,
"autogenerated": false,
"ratio": 4.704989154013015,
... |
__author__ = 'Tom Schaul, tom@idsia.ch'
from scipy import array, zeros
from random import choice
from maze import MazeTask
class TMaze(MazeTask):
"""
#############
###########*#
#. #
########### #
#############
1-in-n encoding for observations.
"""
discount = 0.98
... | {
"repo_name": "fxsjy/pybrain",
"path": "pybrain/rl/environments/mazes/tasks/tmaze.py",
"copies": "6",
"size": "1654",
"license": "bsd-3-clause",
"hash": 4396066118328538600,
"line_mean": 23.6865671642,
"line_max": 64,
"alpha_frac": 0.4830713422,
"autogenerated": false,
"ratio": 3.38241308793456,
... |
__author__ = 'Tom Schaul, tom@idsia.ch'
from scipy import array, zeros
from random import choice
from .maze import MazeTask
class TMaze(MazeTask):
"""
#############
###########*#
#. #
########### #
#############
1-in-n encoding for observations.
"""
discount = 0.98
... | {
"repo_name": "jlegendary/pybrain",
"path": "pybrain/rl/environments/mazes/tasks/tmaze.py",
"copies": "25",
"size": "1655",
"license": "bsd-3-clause",
"hash": 1895680006386757000,
"line_mean": 23.7014925373,
"line_max": 64,
"alpha_frac": 0.4827794562,
"autogenerated": false,
"ratio": 3.3775510204... |
__author__ = 'Tom Schaul, tom@idsia.ch'
from scipy import array, zeros
from random import choice
from maze import MazeTask
class TMaze(MazeTask):
"""
#############
###########*#
#. #
########### #
#############
1-in-n encoding for observations.
"""
discount... | {
"repo_name": "daanwierstra/pybrain",
"path": "pybrain/rl/tasks/pomdp/tmaze.py",
"copies": "1",
"size": "1670",
"license": "bsd-3-clause",
"hash": -3050693633553585000,
"line_mean": 23.9402985075,
"line_max": 62,
"alpha_frac": 0.4784431138,
"autogenerated": false,
"ratio": 3.4291581108829567,
"... |
__author__ = 'Tom Schaul, tom@idsia.ch'
from scipy import array, zeros
from random import random
from .maze import MazeTask
from pybrain.rl.environments.mazes import PolarMaze
class ShuttleDocking(MazeTask):
"""
#######
#. *#
#######
The spaceship needs to dock backwards into the goal station... | {
"repo_name": "cmorgan/pybrain",
"path": "pybrain/rl/environments/mazes/tasks/shuttle.py",
"copies": "25",
"size": "2692",
"license": "bsd-3-clause",
"hash": 5297594348765394000,
"line_mean": 26.7525773196,
"line_max": 88,
"alpha_frac": 0.4977711738,
"autogenerated": false,
"ratio": 3.46460746460... |
__author__ = 'Tom Schaul, tom@idsia.ch'
from scipy import array,zeros
from random import random
from maze import MazeTask
from pybrain.rl.environments.mazes import PolarMaze
class ShuttleDocking(MazeTask):
"""
#######
#. *#
#######
The spaceship needs to dock backwards into the goal stati... | {
"repo_name": "daanwierstra/pybrain",
"path": "pybrain/rl/tasks/pomdp/shuttle.py",
"copies": "1",
"size": "2804",
"license": "bsd-3-clause",
"hash": -1656404124249942800,
"line_mean": 27.9175257732,
"line_max": 88,
"alpha_frac": 0.4778887304,
"autogenerated": false,
"ratio": 3.6180645161290323,
... |
__author__ = 'Tom Schaul, tom@idsia.ch'
from scipy import clip, asarray
from pybrain.utilities import abstractMethod
class Task(object):
""" A task is associating a purpose with an environment. It decides how to evaluate the
observations, potentially returning reinforcement rewards or fitness values.
Fur... | {
"repo_name": "arabenjamin/pybrain",
"path": "pybrain/rl/environments/task.py",
"copies": "26",
"size": "3088",
"license": "bsd-3-clause",
"hash": 2163094764573265000,
"line_mean": 36.2048192771,
"line_max": 116,
"alpha_frac": 0.5955310881,
"autogenerated": false,
"ratio": 3.969151670951157,
"c... |
__author__ = 'Tom Schaul, tom@idsia.ch'
from scipy import ones, dot
from sequential import SequentialDataSet
from pybraingpu.utilities import fListToString
# CHECKME: does this provide for importance-datasets in the non-sequential case
# maybe there should be a second class - or another structure!
class Importanc... | {
"repo_name": "firestrand/pybrain-gpu",
"path": "pybraingpu/datasets/importance.py",
"copies": "1",
"size": "1816",
"license": "bsd-3-clause",
"hash": -6063725441840007000,
"line_mean": 36.8333333333,
"line_max": 83,
"alpha_frac": 0.6128854626,
"autogenerated": false,
"ratio": 4.117913832199546,
... |
__author__ = 'Tom Schaul, tom@idsia.ch'
from scipy import ones, dot
from sequential import SequentialDataSet
from pybrain.utilities import fListToString
# CHECKME: does this provide for importance-datasets in the non-sequential case
# maybe there should be a second class - or another structure!
class ImportanceDa... | {
"repo_name": "daanwierstra/pybrain",
"path": "pybrain/datasets/importance.py",
"copies": "1",
"size": "1829",
"license": "bsd-3-clause",
"hash": -142577177742586450,
"line_mean": 37.9361702128,
"line_max": 83,
"alpha_frac": 0.6112629852,
"autogenerated": false,
"ratio": 4.16628701594533,
"conf... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.