2019-05-25 13:56:33 +01:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, pythonOlder
|
|
|
|
, fetchPypi
|
|
|
|
, tensorflow
|
|
|
|
, annoy
|
|
|
|
, pillow
|
|
|
|
, matplotlib
|
|
|
|
, numpy
|
|
|
|
, pandas
|
|
|
|
, pygame
|
|
|
|
, pyopengl
|
|
|
|
, scipy
|
|
|
|
, scikitimage
|
|
|
|
, gym
|
|
|
|
, bokeh
|
|
|
|
, kubernetes
|
|
|
|
, redis
|
|
|
|
, minio
|
|
|
|
, pytest
|
|
|
|
, psutil
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
2019-06-20 22:18:10 +01:00
|
|
|
version = "0.12.1";
|
2019-05-25 13:56:33 +01:00
|
|
|
pname = "rl-coach";
|
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2019-06-20 22:18:10 +01:00
|
|
|
sha256 = "1zqlq61zxn732915nznj7pz8zh6kd6inl170fiavwhs32brmv84l";
|
2019-05-25 13:56:33 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
tensorflow
|
|
|
|
annoy
|
|
|
|
pillow
|
|
|
|
matplotlib
|
|
|
|
numpy
|
|
|
|
pandas
|
|
|
|
pygame
|
|
|
|
pyopengl
|
|
|
|
scipy
|
|
|
|
scikitimage
|
|
|
|
gym
|
|
|
|
bokeh
|
|
|
|
kubernetes
|
|
|
|
redis
|
|
|
|
minio
|
|
|
|
psutil
|
|
|
|
];
|
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
pytest
|
|
|
|
];
|
|
|
|
|
|
|
|
# run only some tests that do not need any optional dependencies
|
|
|
|
# available tests: https://github.com/NervanaSystems/coach/tree/master/rl_coach/tests
|
|
|
|
testsToRun = [
|
|
|
|
# test only the tensorflow backend (not mxnet)
|
|
|
|
"architectures/tensorflow_components"
|
|
|
|
"agents"
|
|
|
|
"exploration_policies"
|
|
|
|
"filters"
|
|
|
|
"memories"
|
|
|
|
"utils"
|
|
|
|
];
|
|
|
|
checkPhase = let
|
|
|
|
fullTestPaths = map (testfile: "rl_coach/tests/${testfile}") testsToRun;
|
|
|
|
escapedPaths = map lib.escapeShellArg fullTestPaths;
|
|
|
|
pytestArgs = builtins.concatStringsSep " " escapedPaths;
|
|
|
|
in
|
|
|
|
''
|
|
|
|
pytest ${pytestArgs}
|
|
|
|
'';
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
# pinned to 8.0.1 for unknown reason, at least basic functionallity seems to work without it
|
|
|
|
# https://github.com/NervanaSystems/coach/pull/149#issuecomment-495915804
|
|
|
|
sed -i '/kubernetes/d' requirements.txt
|
|
|
|
|
|
|
|
# this is just an "intel-optimized" version of tensorflow, e.g. an implementation detail
|
|
|
|
sed -i 's/intel-tensorflow/tensorflow/g' setup.py
|
|
|
|
|
|
|
|
# backports of python3 features not needed
|
|
|
|
# https://github.com/NervanaSystems/coach/issues/324
|
|
|
|
sed -i '/futures/d' requirements.txt
|
|
|
|
'';
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.5"; # minimum required version
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Enables easy experimentation with state of the art Reinforcement Learning algorithms";
|
|
|
|
homepage = "https://nervanasystems.github.io/coach/";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ timokau ];
|
|
|
|
};
|
|
|
|
}
|