2018-08-13 19:06:09 +01:00
|
|
|
{ pkgs, haskellLib }:
|
|
|
|
|
|
|
|
with haskellLib;
|
|
|
|
|
|
|
|
self: super:
|
|
|
|
let
|
2020-04-15 12:00:12 +01:00
|
|
|
# This contains updates to the dependencies, without which it would
|
|
|
|
# be even more work to get it to build.
|
|
|
|
# As of 2020-04, there's no new release in sight, which is why we're
|
|
|
|
# pulling from Github.
|
2018-08-13 19:06:09 +01:00
|
|
|
tensorflow-haskell = pkgs.fetchFromGitHub {
|
|
|
|
owner = "tensorflow";
|
|
|
|
repo = "haskell";
|
2020-05-22 12:28:02 +01:00
|
|
|
rev = "568c9b6f03e5d66a25685a776386e2ff50b61aa9";
|
|
|
|
sha256 = "0v58zhqipa441hzdvp9pwgv6srir2fm7cp0bq2pb5jl1imwyd37h";
|
2018-08-13 19:06:09 +01:00
|
|
|
fetchSubmodules = true;
|
|
|
|
};
|
|
|
|
|
2020-04-15 12:00:12 +01:00
|
|
|
setTensorflowSourceRoot = dir: drv:
|
|
|
|
(overrideCabal drv (drv: { src = tensorflow-haskell; }))
|
|
|
|
.overrideAttrs (_oldAttrs: {sourceRoot = "source/${dir}";});
|
2018-08-13 19:06:09 +01:00
|
|
|
in
|
|
|
|
{
|
2020-05-22 12:28:02 +01:00
|
|
|
tensorflow-proto = doJailbreak (setTensorflowSourceRoot "tensorflow-proto" super.tensorflow-proto);
|
2020-04-15 12:00:12 +01:00
|
|
|
|
|
|
|
tensorflow = (setTensorflowSourceRoot "tensorflow" super.tensorflow).override {
|
|
|
|
# the "regular" Python package does not seem to include the binary library
|
|
|
|
libtensorflow = pkgs.libtensorflow-bin;
|
2018-08-13 19:06:09 +01:00
|
|
|
};
|
2020-04-15 12:00:12 +01:00
|
|
|
|
2020-05-22 12:28:02 +01:00
|
|
|
tensorflow-core-ops = setTensorflowSourceRoot "tensorflow-core-ops" super.tensorflow-core-ops;
|
2020-04-15 12:00:12 +01:00
|
|
|
|
2020-05-22 12:28:02 +01:00
|
|
|
tensorflow-logging = setTensorflowSourceRoot "tensorflow-logging" super.tensorflow-logging;
|
2020-04-15 12:00:12 +01:00
|
|
|
|
|
|
|
tensorflow-mnist = (setTensorflowSourceRoot "tensorflow-mnist" super.tensorflow-mnist).override {
|
2018-09-06 07:49:17 +01:00
|
|
|
# https://github.com/tensorflow/haskell/issues/215
|
|
|
|
tensorflow-mnist-input-data = self.tensorflow-mnist-input-data;
|
2020-04-15 12:00:12 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
tensorflow-mnist-input-data = setTensorflowSourceRoot "tensorflow-mnist-input-data" (super.callPackage (
|
2018-08-13 19:06:09 +01:00
|
|
|
{ mkDerivation, base, bytestring, Cabal, cryptonite, directory
|
|
|
|
, filepath, HTTP, network-uri, stdenv
|
|
|
|
}:
|
2018-09-05 16:11:02 +01:00
|
|
|
|
|
|
|
let
|
2018-09-06 07:43:04 +01:00
|
|
|
fileInfos = {
|
|
|
|
"train-images-idx3-ubyte.gz" = "440fcabf73cc546fa21475e81ea370265605f56be210a4024d2ca8f203523609";
|
|
|
|
"train-labels-idx1-ubyte.gz" = "3552534a0a558bbed6aed32b30c495cca23d567ec52cac8be1a0730e8010255c";
|
|
|
|
"t10k-images-idx3-ubyte.gz" = "8d422c7b0a1c1c79245a5bcf07fe86e33eeafee792b84584aec276f5a2dbc4e6";
|
|
|
|
"t10k-labels-idx1-ubyte.gz" = "f7ae60f92e00ec6debd23a6088c31dbd2371eca3ffa0defaefb259924204aec6";
|
|
|
|
};
|
|
|
|
downloads = with pkgs.lib; flip mapAttrsToList fileInfos (name: sha256:
|
|
|
|
pkgs.fetchurl {
|
|
|
|
url = "http://yann.lecun.com/exdb/mnist/${name}";
|
|
|
|
inherit sha256;
|
|
|
|
});
|
2018-09-05 16:11:02 +01:00
|
|
|
in
|
2018-08-13 19:06:09 +01:00
|
|
|
mkDerivation {
|
|
|
|
pname = "tensorflow-mnist-input-data";
|
|
|
|
version = "0.1.0.0";
|
|
|
|
enableSeparateDataOutput = true;
|
|
|
|
setupHaskellDepends = [
|
|
|
|
base bytestring Cabal cryptonite directory filepath HTTP
|
|
|
|
network-uri
|
|
|
|
];
|
2018-09-05 16:11:02 +01:00
|
|
|
preConfigure = pkgs.lib.strings.concatStringsSep "\n" (
|
2018-09-06 07:44:19 +01:00
|
|
|
map (x: "ln -s ${x} data/$(stripHash ${x})") downloads
|
2018-09-05 16:11:02 +01:00
|
|
|
);
|
2018-08-13 19:06:09 +01:00
|
|
|
libraryHaskellDepends = [ base ];
|
|
|
|
homepage = "https://github.com/tensorflow/haskell#readme";
|
|
|
|
description = "Downloader of input data for training MNIST";
|
|
|
|
license = stdenv.lib.licenses.asl20;
|
|
|
|
}
|
|
|
|
) {});
|
2020-04-15 12:00:12 +01:00
|
|
|
|
2020-05-22 12:28:02 +01:00
|
|
|
tensorflow-opgen = setTensorflowSourceRoot "tensorflow-opgen" super.tensorflow-opgen;
|
2020-04-15 12:00:12 +01:00
|
|
|
|
2020-05-22 12:28:02 +01:00
|
|
|
tensorflow-ops = setTensorflowSourceRoot "tensorflow-ops" super.tensorflow-ops;
|
2018-08-13 19:06:09 +01:00
|
|
|
}
|