2022-01-07 04:07:37 +00:00
|
|
|
{ absl-py
|
|
|
|
, buildPythonPackage
|
|
|
|
, chex
|
|
|
|
, dm-haiku
|
|
|
|
, fetchFromGitHub
|
|
|
|
, jaxlib
|
|
|
|
, lib
|
|
|
|
, numpy
|
2022-04-03 18:54:34 +00:00
|
|
|
, pytest-xdist
|
2022-01-07 04:07:37 +00:00
|
|
|
, pytestCheckHook
|
2022-04-03 18:54:34 +00:00
|
|
|
, tensorflow
|
|
|
|
, tensorflow-datasets
|
2022-01-07 04:07:37 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "optax";
|
2022-04-03 18:54:34 +00:00
|
|
|
version = "0.1.1";
|
2022-01-07 04:07:37 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "deepmind";
|
|
|
|
repo = pname;
|
2022-04-03 18:54:34 +00:00
|
|
|
rev = "v${version}";
|
|
|
|
hash = "sha256-s/BcqzhdfWzR61MStusUPQtuT4+t8NcC5gBGiGggFqw=";
|
2022-01-07 04:07:37 +00:00
|
|
|
};
|
|
|
|
|
2022-02-10 20:34:41 +00:00
|
|
|
buildInputs = [ jaxlib ];
|
|
|
|
|
2022-01-07 04:07:37 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
absl-py
|
|
|
|
chex
|
|
|
|
numpy
|
|
|
|
];
|
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
dm-haiku
|
2022-04-03 18:54:34 +00:00
|
|
|
pytest-xdist
|
2022-01-07 04:07:37 +00:00
|
|
|
pytestCheckHook
|
2022-04-03 18:54:34 +00:00
|
|
|
tensorflow
|
|
|
|
tensorflow-datasets
|
2022-01-07 04:07:37 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"optax"
|
|
|
|
];
|
|
|
|
|
|
|
|
disabledTestPaths = [
|
|
|
|
# Requires `flax` which depends on `optax` creating circular dependency.
|
|
|
|
"optax/_src/equivalence_test.py"
|
2022-04-03 18:54:34 +00:00
|
|
|
# See https://github.com/deepmind/optax/issues/323.
|
2022-01-07 04:07:37 +00:00
|
|
|
"examples/lookahead_mnist_test.py"
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Optax is a gradient processing and optimization library for JAX.";
|
|
|
|
homepage = "https://github.com/deepmind/optax";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ ndl ];
|
|
|
|
};
|
|
|
|
}
|