X-Git-Url: https://git.hcoop.net/jackhill/guix/guix.git/blobdiff_plain/d9544d91a6421da9e4d428536c6138bc5b01e1d3..6e05adbb8f0396ef2bffef9cf56248e68aa8a3df:/gnu/packages/machine-learning.scm diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm index ab4150cbb1..89345fa5fd 100644 --- a/gnu/packages/machine-learning.scm +++ b/gnu/packages/machine-learning.scm @@ -1,9 +1,9 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2015, 2016, 2017, 2018, 2019 Ricardo Wurmus -;;; Copyright © 2016 Efraim Flashner -;;; Copyright © 2016, 2017 Marius Bakke +;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020 Ricardo Wurmus +;;; Copyright © 2016, 2020 Efraim Flashner +;;; Copyright © 2016, 2017, 2020 Marius Bakke ;;; Copyright © 2016 Hartmut Goebel -;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice +;;; Copyright © 2018, 2019, 2020 Tobias Geerinckx-Rice ;;; Copyright © 2018 Kei Kebreau ;;; Copyright © 2018 Mark Meyer ;;; Copyright © 2018 Ben Woodcroft @@ -11,7 +11,11 @@ ;;; Copyright © 2018 Julien Lepiller ;;; Copyright © 2018 Björn Höfling ;;; Copyright © 2019 Nicolas Goaziou -;;; Copyright © 2019 Guillaume Le Vaillant +;;; Copyright © 2019, 2020 Guillaume Le Vaillant +;;; Copyright © 2019 Brett Gilio +;;; Copyright © 2020 Konrad Hinsen +;;; Copyright © 2020 Edouard Klein +;;; Copyright © 2020 Vinicius Monego ;;; ;;; This file is part of GNU Guix. ;;; @@ -34,7 +38,6 @@ #:use-module (guix utils) #:use-module (guix download) #:use-module (guix svn-download) - #:use-module (guix build-system asdf) #:use-module (guix build-system cmake) #:use-module (guix build-system gnu) #:use-module (guix build-system ocaml) @@ -51,6 +54,7 @@ #:use-module (gnu packages boost) #:use-module (gnu packages check) #:use-module (gnu packages compression) + #:use-module (gnu packages cmake) #:use-module (gnu packages cran) #:use-module (gnu packages databases) #:use-module (gnu packages dejagnu) @@ -60,7 +64,6 @@ #:use-module (gnu packages gstreamer) #:use-module (gnu packages image) #:use-module (gnu packages linux) - #:use-module (gnu packages lisp) #:use-module (gnu packages maths) #:use-module (gnu packages mpi) #:use-module (gnu packages ocaml) @@ -69,15 +72,16 @@ #:use-module (gnu packages pkg-config) #:use-module (gnu packages protobuf) #:use-module (gnu packages python) + #:use-module (gnu packages python-check) #:use-module (gnu packages python-science) #:use-module (gnu packages python-web) #:use-module (gnu packages python-xyz) + #:use-module (gnu packages rpc) #:use-module (gnu packages serialization) #:use-module (gnu packages sphinx) #:use-module (gnu packages statistics) #:use-module (gnu packages sqlite) #:use-module (gnu packages swig) - #:use-module (gnu packages tls) #:use-module (gnu packages web) #:use-module (gnu packages xml) #:use-module (gnu packages xorg) @@ -92,7 +96,7 @@ (source (origin (method git-fetch) (uri (git-reference - (url "https://github.com/libfann/fann.git") + (url "https://github.com/libfann/fann") (commit commit))) (file-name (string-append name "-" version "-checkout")) (sha256 @@ -143,7 +147,7 @@ sparsely connected networks.") "svm-predict" "svm-scale"))) #t))))) - (home-page "http://www.csie.ntu.edu.tw/~cjlin/libsvm/") + (home-page "https://www.csie.ntu.edu.tw/~cjlin/libsvm/") (synopsis "Library for Support Vector Machines") (description "LIBSVM is a machine learning library for support vector @@ -205,6 +209,8 @@ classification.") (arguments `(#:imported-modules (,@%gnu-build-system-modules (guix build python-build-system)) + #:modules ((guix build python-build-system) + ,@%gnu-build-system-modules) #:phases (modify-phases %standard-phases (add-after 'unpack 'enter-dir @@ -312,7 +318,7 @@ networks) based on simulation of (stochastic) flow in graphs.") (origin (method git-fetch) (uri (git-reference - (url "https://github.com/fhcrc/mcl.git") + (url "https://github.com/fhcrc/mcl") (commit version))) (file-name (git-file-name name version)) (sha256 @@ -409,14 +415,14 @@ sample proximities between pairs of cases.") (define-public openfst (package (name "openfst") - (version "1.7.2") + (version "1.7.9") (source (origin (method url-fetch) (uri (string-append "http://www.openfst.org/twiki/pub/FST/" "FstDownload/openfst-" version ".tar.gz")) (sha256 (base32 - "0fqgk8195kz21is09gwzwnrg7fr9526bi9mh4apyskapz27pbhr1")))) + "1pmx1yhn2gknj0an0zwqmzgwjaycapi896244np50a8y3nrsw6ck")))) (build-system gnu-build-system) (home-page "http://www.openfst.org") (synopsis "Library for weighted finite-state transducers") @@ -563,16 +569,56 @@ optimizing, and searching weighted finite-state transducers (FSTs).") ;; Non-portable SSE instructions are used so building fails on platforms ;; other than x86_64. (supported-systems '("x86_64-linux")) - (home-page "http://shogun-toolbox.org/") + (home-page "https://shogun-toolbox.org/") (synopsis "Machine learning toolbox") (description "The Shogun Machine learning toolbox provides a wide range of unified and -efficient Machine Learning (ML) methods. The toolbox seamlessly allows to -combine multiple data representations, algorithm classes, and general purpose +efficient Machine Learning (ML) methods. The toolbox seamlessly +combines multiple data representations, algorithm classes, and general purpose tools. This enables both rapid prototyping of data pipelines and extensibility in terms of new algorithms.") (license license:gpl3+))) +(define-public python-onnx + (package + (name "python-onnx") + (version "1.7.0") + (source + (origin + (method url-fetch) + (uri (pypi-uri "onnx" version)) + ;; ONNX will build googletest from a git checkout. Patch CMake + ;; to use googletest from Guix and enable tests by default. + (patches (search-patches "python-onnx-use-system-googletest.patch")) + (sha256 + (base32 "0j6rgfbhsw3a8id8pyg18y93k68lbjbj1kq6qia36h69f6pvlyjy")))) + (build-system python-build-system) + (native-inputs + `(("cmake" ,cmake) + ("googletest" ,googletest) + ("pybind11" ,pybind11) + ("python-coverage" ,python-coverage) + ("python-nbval" ,python-nbval) + ("python-pytest" ,python-pytest) + ("python-pytest-runner" ,python-pytest-runner))) + (inputs + `(("protobuf" ,protobuf))) + (propagated-inputs + `(("python-numpy" ,python-numpy) + ("python-protobuf" ,python-protobuf) + ("python-six" ,python-six) + ("python-tabulate" ,python-tabulate) + ("python-typing-extensions" + ,python-typing-extensions))) + (home-page "https://onnx.ai/") + (synopsis "Open Neural Network Exchange") + (description + "Open Neural Network Exchange (ONNX) provides an open source format for +AI models, both deep learning and traditional ML. It defines an extensible +computation graph model, as well as definitions of built-in operators and +standard data types.") + (license license:expat))) + (define-public rxcpp (package (name "rxcpp") @@ -581,7 +627,7 @@ in terms of new algorithms.") (origin (method git-fetch) (uri (git-reference - (url "https://github.com/ReactiveX/RxCpp.git") + (url "https://github.com/ReactiveX/RxCpp") (commit (string-append "v" version)))) (sha256 (base32 "1rdpa3jlc181jd08nk437aar085h28i45s6nzrv65apb3xyyz0ij")) @@ -614,42 +660,6 @@ synchronization, thread-safety, concurrent data structures, and non-blocking I/O.") (license license:asl2.0))) -(define-public r-adaptivesparsity - (package - (name "r-adaptivesparsity") - (version "1.6") - (source (origin - (method url-fetch) - (uri (cran-uri "AdaptiveSparsity" version)) - (sha256 - (base32 - "0imr5m8mll9j6n4icsv6z9rl5kbnwsp9wvzrg7n90nnmcxq2cz91")))) - (properties - `((upstream-name . "AdaptiveSparsity"))) - (build-system r-build-system) - (arguments - `(#:phases - (modify-phases %standard-phases - (add-after 'unpack 'link-against-armadillo - (lambda _ - (substitute* "src/Makevars" - (("PKG_LIBS=" prefix) - (string-append prefix "-larmadillo")))))))) - (propagated-inputs - `(("r-mass" ,r-mass) - ("r-matrix" ,r-matrix) - ("r-rcpp" ,r-rcpp) - ("r-rcpparmadillo" ,r-rcpparmadillo))) - (inputs - `(("armadillo" ,armadillo))) - (home-page "https://cran.r-project.org/web/packages/AdaptiveSparsity") - (synopsis "Adaptive sparsity models") - (description - "This package implements the Figueiredo machine learning algorithm for -adaptive sparsity and the Wong algorithm for adaptively sparse gaussian -geometric models.") - (license license:lgpl3+))) - (define-public gemmlowp-for-tensorflow ;; The commit hash is taken from "tensorflow/workspace.bzl". (let ((commit "38ebac7b059e84692f53e5938f97a9943c120d98") @@ -710,14 +720,14 @@ than 8 bits, and at the end only some significant 8 bits are kept.") (define-public dlib (package (name "dlib") - (version "19.7") + (version "19.20") (source (origin (method url-fetch) (uri (string-append "http://dlib.net/files/dlib-" version ".tar.bz2")) (sha256 (base32 - "1mljz02kwkrbggyncxv5fpnyjdybw2qihaacb3js8yfkw12vwpc2")) + "139jyi19qz37wwmmy48gil9d1kkh2r3w3bwdzabha6ayxmba96nz")) (modules '((guix build utils))) (snippet '(begin @@ -727,7 +737,8 @@ than 8 bits, and at the end only some significant 8 bits are kept.") #t)))) (build-system cmake-build-system) (arguments - `(#:phases + `(#:configure-flags '("-DBUILD_SHARED_LIBS=ON") + #:phases (modify-phases %standard-phases (add-after 'unpack 'disable-asserts (lambda _ @@ -764,12 +775,7 @@ than 8 bits, and at the end only some significant 8 bits are kept.") (with-directory-excursion test-dir (invoke "make" "-j" (number->string (parallel-job-count))) (invoke "./dtest" "--runall")) - #t))) - (add-after 'install 'delete-static-library - (lambda* (#:key outputs #:allow-other-keys) - (delete-file (string-append (assoc-ref outputs "out") - "/lib/libdlib.a")) - #t))))) + #t)))))) (native-inputs `(("pkg-config" ,pkg-config) ;; For tests. @@ -777,7 +783,7 @@ than 8 bits, and at the end only some significant 8 bits are kept.") (inputs `(("giflib" ,giflib) ("lapack" ,lapack) - ("libjpeg" ,libjpeg) + ("libjpeg" ,libjpeg-turbo) ("libpng" ,libpng) ("libx11" ,libx11) ("openblas" ,openblas) @@ -795,17 +801,17 @@ computing environments.") (define-public python-scikit-learn (package (name "python-scikit-learn") - (version "0.20.4") + (version "0.22.1") (source (origin (method git-fetch) (uri (git-reference - (url "https://github.com/scikit-learn/scikit-learn.git") + (url "https://github.com/scikit-learn/scikit-learn") (commit version))) (file-name (git-file-name name version)) (sha256 (base32 - "08zbzi8yx5wdlxfx9jap61vg1malc9ajf576w7a0liv6jvvrxlpj")))) + "1xqxv210gsmjw094vc5ghq2y9lmm74qkk22pq6flcjzj51b86jxf")))) (build-system python-build-system) (arguments `(#:phases @@ -837,16 +843,61 @@ computing environments.") ("python-cython" ,python-cython))) (propagated-inputs `(("python-numpy" ,python-numpy) - ("python-scipy" ,python-scipy))) - (home-page "http://scikit-learn.org/") + ("python-scipy" ,python-scipy) + ("python-joblib" ,python-joblib))) + (home-page "https://scikit-learn.org/") (synopsis "Machine Learning in Python") (description "Scikit-learn provides simple and efficient tools for data mining and data analysis.") + (properties `((python2-variant . ,(delay python2-scikit-learn)))) (license license:bsd-3))) +;; scikit-learn 0.22 and later only supports Python 3, so we stick with +;; an older version here. (define-public python2-scikit-learn - (package-with-python2 python-scikit-learn)) + (let ((base (package-with-python2 (strip-python2-variant python-scikit-learn)))) + (package + (inherit base) + (version "0.20.4") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/scikit-learn/scikit-learn") + (commit version))) + (file-name (git-file-name "python-scikit-learn" version)) + (sha256 + (base32 + "08zbzi8yx5wdlxfx9jap61vg1malc9ajf576w7a0liv6jvvrxlpj"))))))) + +(define-public python-scikit-rebate + (package + (name "python-scikit-rebate") + (version "0.6") + (source (origin + (method url-fetch) + (uri (pypi-uri "skrebate" version)) + (sha256 + (base32 + "1h7qs9gjxpzqabzhb8rmpv3jpmi5iq41kqdibg48299h94iikiw7")))) + (build-system python-build-system) + ;; Pandas is only needed to run the tests. + (native-inputs + `(("python-pandas" ,python-pandas))) + (propagated-inputs + `(("python-numpy" ,python-numpy) + ("python-scipy" ,python-scipy) + ("python-scikit-learn" ,python-scikit-learn) + ("python-joblib" ,python-joblib))) + (home-page "https://epistasislab.github.io/scikit-rebate/") + (synopsis "Relief-based feature selection algorithms for Python") + (description "Scikit-rebate is a scikit-learn-compatible Python +implementation of ReBATE, a suite of Relief-based feature selection algorithms +for Machine Learning. These algorithms excel at identifying features that are +predictive of the outcome in supervised learning problems, and are especially +good at identifying feature interactions that are normally overlooked by +standard feature selection algorithms.") + (license license:expat))) (define-public python-autograd (let* ((commit "442205dfefe407beffb33550846434baa90c4de7") @@ -896,14 +947,14 @@ main intended application of Autograd is gradient-based optimization.") (name "lightgbm") (version "2.0.12") (source (origin - (method url-fetch) - (uri (string-append - "https://github.com/Microsoft/LightGBM/archive/v" - version ".tar.gz")) + (method git-fetch) + (uri (git-reference + (url "https://github.com/Microsoft/LightGBM") + (commit (string-append "v" version)))) (sha256 (base32 - "132zf0yk0545mg72hyzxm102g3hpb6ixx9hnf8zd2k55gas6cjj1")) - (file-name (string-append name "-" version ".tar.gz")))) + "0jlvyn7k81dzrh9ij3zw576wbgiwmmr26rzpdxjn1dbpc3njpvzi")) + (file-name (git-file-name name version)))) (native-inputs `(("python-pytest" ,python-pytest) ("python-nose" ,python-nose))) @@ -918,8 +969,8 @@ main intended application of Autograd is gradient-based optimization.") #:phases (modify-phases %standard-phases (replace 'check - (lambda* (#:key outputs #:allow-other-keys) - (with-directory-excursion ,(string-append "../LightGBM-" version) + (lambda _ + (with-directory-excursion "../source" (invoke "pytest" "tests/c_api_test/test_.py"))))))) (build-system cmake-build-system) (home-page "https://github.com/Microsoft/LightGBM") @@ -943,21 +994,35 @@ the following advantages: (name "vowpal-wabbit") (version "8.5.0") (source (origin - (method url-fetch) - (uri (string-append - "https://github.com/JohnLangford/vowpal_wabbit/archive/" - version ".tar.gz")) + (method git-fetch) + (uri (git-reference + (url "https://github.com/JohnLangford/vowpal_wabbit") + (commit version))) (sha256 (base32 - "0clp2kb7rk5sckhllxjr5a651awf4s8dgzg4659yh4hf5cqnf0gr")) - (file-name (string-append name "-" version ".tar.gz")))) + "04bwzk6ifgnz3fmzid8b7avxf9n5pnx9xcjm61nkjng1vv0bpj8x")) + (file-name (git-file-name name version)))) (inputs `(("boost" ,boost) ("zlib" ,zlib))) (arguments `(#:configure-flags (list (string-append "--with-boost=" - (assoc-ref %build-inputs "boost"))))) + (assoc-ref %build-inputs "boost"))) + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'make-files-writable + (lambda _ + (for-each make-file-writable (find-files "." ".*")) #t)) + (add-after 'install 'install-more-headers + (lambda* (#:key outputs #:allow-other-keys) + (for-each + (lambda (file) + (install-file file (string-append + (assoc-ref outputs "out") + "/include/vowpalwabbit"))) + (find-files "vowpalwabbit" "\\.h$")) + #t))))) (build-system gnu-build-system) (home-page "https://github.com/JohnLangford/vowpal_wabbit") (synopsis "Fast machine learning library for online learning") @@ -1003,20 +1068,20 @@ association studies (GWAS) on extremely large data sets.") ;; There have been no proper releases yet. (define-public kaldi - (let ((commit "2f95609f0bb085bd3a1dc5eb0a39f3edea59e606") - (revision "1")) + (let ((commit "d4791c0f3fc1a09c042dac365e120899ee2ad21e") + (revision "2")) (package (name "kaldi") (version (git-version "0" revision commit)) (source (origin (method git-fetch) (uri (git-reference - (url "https://github.com/kaldi-asr/kaldi.git") + (url "https://github.com/kaldi-asr/kaldi") (commit commit))) (file-name (git-file-name name version)) (sha256 (base32 - "082qh3pfi7hvncylp4xsmkfahbd7gb0whdfa4rwrx7fxk9rdh3kz")))) + "07k80my6f19mhrkwbzhjsnpf9871wmrwkl0ym468i830w67qyjrz")))) (build-system gnu-build-system) (arguments `(#:test-target "test" @@ -1114,20 +1179,20 @@ written in C++.") (license license:asl2.0)))) (define-public gst-kaldi-nnet2-online - (let ((commit "617e43e73c7cc45eb9119028c02bd4178f738c4a") - (revision "1")) + (let ((commit "cb227ef43b66a9835c14eb0ad39e08ee03c210ad") + (revision "2")) (package (name "gst-kaldi-nnet2-online") (version (git-version "0" revision commit)) (source (origin (method git-fetch) (uri (git-reference - (url "https://github.com/alumae/gst-kaldi-nnet2-online.git") + (url "https://github.com/alumae/gst-kaldi-nnet2-online") (commit commit))) (file-name (git-file-name name version)) (sha256 (base32 - "0xh3w67b69818s6ib02ara4lw7wamjdmh4jznvkpzrs4skbs9jx9")))) + "1i6ffwiavxx07ri0lxix6s8q0r31x7i4xxvhys5jxkixf5q34w8g")))) (build-system gnu-build-system) (arguments `(#:tests? #f ; there are none @@ -1185,20 +1250,21 @@ automatically.") (license license:asl2.0)))) (define-public kaldi-gstreamer-server - (let ((commit "1735ba49c5dc0ebfc184e45105fc600cd9f1f508") - (revision "1")) + ;; This is the tip of the py3 branch + (let ((commit "f68cab490be7eb0da2af1475fbc16655f50a60cb") + (revision "2")) (package (name "kaldi-gstreamer-server") (version (git-version "0" revision commit)) (source (origin (method git-fetch) (uri (git-reference - (url "https://github.com/alumae/kaldi-gstreamer-server.git") + (url "https://github.com/alumae/kaldi-gstreamer-server") (commit commit))) (file-name (git-file-name name version)) (sha256 (base32 - "0j701m7lbwmzqxsfanj882v7881hrbmpqybbczbxqpcbg8q34w0k")))) + "17lh1368vkg8ngrcbn2phvigzlmalrqg6djx2gg61qq1a0nj87dm")))) (build-system gnu-build-system) (arguments `(#:tests? #f ; there are no tests that can be run automatically @@ -1214,6 +1280,14 @@ automatically.") ;; are reproducible. (setenv "PYTHONHASHSEED" "0") (with-directory-excursion "kaldigstserver" + ;; See https://github.com/alumae/kaldi-gstreamer-server/issues/232 + (substitute* "master_server.py" + (("\\.replace\\('\\\\.*") ")")) + + ;; This is a Python 2 file + (delete-file "decoder_test.py") + (delete-file "test-buffer.py") + (for-each (lambda (file) (apply invoke `("python" @@ -1264,12 +1338,10 @@ exec ~a ~a/~a \"$@\"~%" #t)))))) (inputs `(("gst-kaldi-nnet2-online" ,gst-kaldi-nnet2-online) - ("python2" ,python-2) - ("python2-futures" ,python2-futures) - ("python2-pygobject" ,python2-pygobject) - ("python2-pyyaml" ,python2-pyyaml) - ("python2-tornado" ,python2-tornado) - ("python2-ws4py" ,python2-ws4py-for-kaldi-gstreamer-server))) + ("python" ,python-wrapper) + ("python-pygobject" ,python-pygobject) + ("python-pyyaml" ,python-pyyaml) + ("python-tornado" ,python-tornado-6))) (home-page "https://github.com/alumae/kaldi-gstreamer-server") (synopsis "Real-time full-duplex speech recognition server") (description "This is a real-time full-duplex speech recognition server, @@ -1277,44 +1349,6 @@ based on the Kaldi toolkit and the GStreamer framework and implemented in Python.") (license license:bsd-2)))) -(define-public grpc - (package - (name "grpc") - (version "1.16.1") - (source (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/grpc/grpc.git") - (commit (string-append "v" version)))) - (file-name (git-file-name name version)) - (sha256 - (base32 - "1jimqz3115f9pli5w6ik9wi7mjc7ix6y7yrq4a1ab9fc3dalj7p2")))) - (build-system cmake-build-system) - (arguments - `(#:tests? #f ; no test target - #:configure-flags - (list "-DgRPC_ZLIB_PROVIDER=package" - "-DgRPC_CARES_PROVIDER=package" - "-DgRPC_SSL_PROVIDER=package" - "-DgRPC_PROTOBUF_PROVIDER=package"))) - (inputs - `(("c-ares" ,c-ares/cmake) - ("openssl" ,openssl) - ("zlib" ,zlib))) - (native-inputs - `(("protobuf" ,protobuf) - ("python" ,python-wrapper))) - (home-page "https://grpc.io") - (synopsis "High performance universal RPC framework") - (description "gRPC is a modern high performance @dfn{Remote Procedure Call} -(RPC) framework that can run in any environment. It can efficiently connect -services in and across data centers with pluggable support for load balancing, -tracing, health checking and authentication. It is also applicable in last -mile of distributed computing to connect devices, mobile applications and -browsers to backend services.") - (license license:asl2.0))) - ;; Note that Tensorflow includes a "third_party" directory, which seems to not ;; only contain modified subsets of upstream library source code, but also ;; adapter headers provided by Google (such as the fft.h header, which is not @@ -1329,7 +1363,7 @@ browsers to backend services.") (origin (method git-fetch) (uri (git-reference - (url "https://github.com/tensorflow/tensorflow.git") + (url "https://github.com/tensorflow/tensorflow") (commit (string-append "v" version)))) (file-name (string-append "tensorflow-" version "-checkout")) (sha256 @@ -1380,7 +1414,11 @@ browsers to backend services.") (list "CC=gcc") #:modules ((ice-9 ftw) (guix build utils) - (guix build cmake-build-system)) + (guix build cmake-build-system) + ((guix build python-build-system) + #:select (python-version))) + #:imported-modules (,@%cmake-build-system-modules + (guix build python-build-system)) #:phases (modify-phases %standard-phases (add-after 'unpack 'set-source-file-times-to-1980 @@ -1405,6 +1443,12 @@ browsers to backend services.") ;; optional package. (substitute* "tensorflow/tools/pip_package/setup.py" ((".*'tensorboard >.*") "")) + + ;; Fix the build with python-3.8, taken from rejected upstream patch: + ;; https://github.com/tensorflow/tensorflow/issues/34197 + (substitute* (find-files "tensorflow/python" ".*\\.cc$") + (("(nullptr,)(\\ +/. tp_print)" _ _ tp_print) + (string-append "NULL, " tp_print))) #t)) (add-after 'python3.7-compatibility 'chdir (lambda _ (chdir "tensorflow/contrib/cmake") #t)) @@ -1594,16 +1638,19 @@ INSTALL_RPATH " (assoc-ref outputs "out") "/lib)\n"))) (invoke "make" "tf_python_build_pip_package") #t)) (add-after 'build-pip-package 'install-python - (lambda* (#:key outputs #:allow-other-keys) + (lambda* (#:key inputs outputs #:allow-other-keys) (let ((out (assoc-ref outputs "out")) - (wheel (car (find-files "../build/tf_python/dist/" "\\.whl$")))) + (wheel (car (find-files "../build/tf_python/dist/" "\\.whl$"))) + (python-version (python-version + (assoc-ref inputs "python")))) (invoke "python" "-m" "pip" "install" wheel (string-append "--prefix=" out)) ;; XXX: broken RUNPATH, see fix-python-build phase. (delete-file (string-append - out "/lib/python3.7/site-packages/tensorflow/contrib/" + out "/lib/python" python-version + "/site-packages/tensorflow/contrib/" "seq2seq/python/ops/lib_beam_search_ops.so")) #t)))))) (native-inputs @@ -1646,7 +1693,7 @@ INSTALL_RPATH " (assoc-ref outputs "out") "/lib)\n"))) (origin (method git-fetch) (uri (git-reference - (url "https://github.com/google/double-conversion.git") + (url "https://github.com/google/double-conversion") (commit commit))) (file-name (git-file-name "double-conversion" @@ -1691,7 +1738,7 @@ INSTALL_RPATH " (assoc-ref outputs "out") "/lib)\n"))) (origin (method git-fetch) (uri (git-reference - (url "https://github.com/google/highwayhash.git") + (url "https://github.com/google/highwayhash") (commit commit))) (file-name (string-append "highwayhash-0-" revision (string-take commit 7) @@ -1745,10 +1792,11 @@ INSTALL_RPATH " (assoc-ref outputs "out") "/lib)\n"))) ("eigen" ,eigen-for-tensorflow) ("gemmlowp" ,gemmlowp-for-tensorflow) ("lmdb" ,lmdb) - ("libjpeg" ,libjpeg) + ("libjpeg" ,libjpeg-turbo) ("libpng" ,libpng) ("giflib" ,giflib) - ("grpc" ,grpc) + ("grpc" ,grpc-1.16.1 "static") + ("grpc:bin" ,grpc-1.16.1) ("jsoncpp" ,jsoncpp-for-tensorflow) ("snappy" ,snappy) ("sqlite" ,sqlite) @@ -1780,11 +1828,12 @@ advanced research.") (build-system python-build-system) (propagated-inputs `(("ipython" ,python-ipython) - ("nose" ,python-nose) ("numpy" ,python-numpy) ("pandas" ,python-pandas) ("scipy" ,python-scipy))) - (home-page "http://github.com/interpretable-ml/iml") + (native-inputs + `(("nose" ,python-nose))) + (home-page "https://github.com/interpretable-ml/iml") (synopsis "Interpretable Machine Learning (iML) package") (description "Interpretable ML (iML) is a set of data type objects, visualizations, and interfaces that can be used by any method designed to @@ -1926,133 +1975,6 @@ that: @end itemize\n") (license license:expat))) -(define-public sbcl-cl-libsvm-format - (let ((commit "3300f84fd8d9f5beafc114f543f9d83417c742fb") - (revision "0")) - (package - (name "sbcl-cl-libsvm-format") - (version (git-version "0.1.0" revision commit)) - (source - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/masatoi/cl-libsvm-format.git") - (commit commit))) - (file-name (git-file-name name version)) - (sha256 - (base32 - "0284aj84xszhkhlivaigf9qj855fxad3mzmv3zfr0qzb5k0nzwrg")))) - (build-system asdf-build-system/sbcl) - (native-inputs - `(("prove" ,sbcl-prove) - ("prove-asdf" ,sbcl-prove-asdf))) - (inputs - `(("alexandria" ,sbcl-alexandria))) - (synopsis "LibSVM data format reader for Common Lisp") - (description - "This Common Lisp library provides a fast reader for data in LibSVM -format.") - (home-page "https://github.com/masatoi/cl-libsvm-format") - (license license:expat)))) - -(define-public cl-libsvm-format - (sbcl-package->cl-source-package sbcl-cl-libsvm-format)) - -(define-public ecl-cl-libsvm-format - (sbcl-package->ecl-package sbcl-cl-libsvm-format)) - -(define-public sbcl-cl-online-learning - (let ((commit "fc7a34f4f161cd1c7dd747d2ed8f698947781423") - (revision "0")) - (package - (name "sbcl-cl-online-learning") - (version (git-version "0.5" revision commit)) - (source - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/masatoi/cl-online-learning.git") - (commit commit))) - (file-name (git-file-name name version)) - (sha256 - (base32 - "14x95rlg80ay5hv645ki57pqvy12v28hz4k1w0f6bsfi2rmpxchq")))) - (build-system asdf-build-system/sbcl) - (native-inputs - `(("prove" ,sbcl-prove) - ("prove-asdf" ,sbcl-prove-asdf))) - (inputs - `(("cl-libsvm-format" ,sbcl-cl-libsvm-format) - ("cl-store" ,sbcl-cl-store))) - (arguments - `(;; FIXME: Tests pass but then the check phase crashes - #:tests? #f)) - (synopsis "Online Machine Learning for Common Lisp") - (description - "This library contains a collection of machine learning algorithms for -online linear classification written in Common Lisp.") - (home-page "https://github.com/masatoi/cl-online-learning") - (license license:expat)))) - -(define-public cl-online-learning - (sbcl-package->cl-source-package sbcl-cl-online-learning)) - -(define-public ecl-cl-online-learning - (sbcl-package->ecl-package sbcl-cl-online-learning)) - -(define-public sbcl-cl-random-forest - (let ((commit "85fbdd4596d40e824f70f1b7cf239cf544e49d51") - (revision "0")) - (package - (name "sbcl-cl-random-forest") - (version (git-version "0.1" revision commit)) - (source - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/masatoi/cl-random-forest.git") - (commit commit))) - (file-name (git-file-name name version)) - (sha256 - (base32 - "097xv60i1ndz68sg9p4pc7c5gvyp9i1xgw966b4wwfq3x6hbz421")))) - (build-system asdf-build-system/sbcl) - (native-inputs - `(("prove" ,sbcl-prove) - ("prove-asdf" ,sbcl-prove-asdf) - ("trivial-garbage" ,sbcl-trivial-garbage))) - (inputs - `(("alexandria" ,sbcl-alexandria) - ("cl-libsvm-format" ,sbcl-cl-libsvm-format) - ("cl-online-learning" ,sbcl-cl-online-learning) - ("lparallel" ,sbcl-lparallel))) - (arguments - `(;; The tests download data from the Internet - #:tests? #f - #:phases - (modify-phases %standard-phases - (add-after 'unpack 'add-sb-cltl2-dependency - (lambda _ - ;; sb-cltl2 is required by lparallel when using sbcl, but it is - ;; not loaded automatically. - (substitute* "cl-random-forest.asd" - (("\\(in-package :cl-user\\)") - "(in-package :cl-user) #+sbcl (require :sb-cltl2)")) - #t))))) - (synopsis "Random Forest and Global Refinement for Common Lisp") - (description - "CL-random-forest is an implementation of Random Forest for multiclass -classification and univariate regression written in Common Lisp. It also -includes an implementation of Global Refinement of Random Forest.") - (home-page "https://github.com/masatoi/cl-random-forest") - (license license:expat)))) - -(define-public cl-random-forest - (sbcl-package->cl-source-package sbcl-cl-random-forest)) - -(define-public ecl-cl-random-forest - (sbcl-package->ecl-package sbcl-cl-random-forest)) - (define-public gloo (let ((version "0.0.0") ; no proper version tag (commit "ca528e32fea9ca8f2b16053cff17160290fc84ce") @@ -2064,7 +1986,7 @@ includes an implementation of Global Refinement of Random Forest.") (origin (method git-fetch) (uri (git-reference - (url "https://github.com/facebookincubator/gloo.git") + (url "https://github.com/facebookincubator/gloo") (commit commit))) (file-name (git-file-name name version)) (sha256 @@ -2088,3 +2010,32 @@ number of collective algorithms useful for machine learning applications. These include a barrier, broadcast, and allreduce.") (home-page "https://github.com/facebookincubator/gloo") (license license:bsd-3)))) + +(define-public python-umap-learn + (package + (name "python-umap-learn") + (version "0.3.10") + (source + (origin + (method url-fetch) + (uri (pypi-uri "umap-learn" version)) + (sha256 + (base32 + "02ada2yy6km6zgk2836kg1c97yrcpalvan34p8c57446finnpki1")))) + (build-system python-build-system) + (native-inputs + `(("python-joblib" ,python-joblib) + ("python-nose" ,python-nose))) + (propagated-inputs + `(("python-numba" ,python-numba) + ("python-numpy" ,python-numpy) + ("python-scikit-learn" ,python-scikit-learn) + ("python-scipy" ,python-scipy))) + (home-page "https://github.com/lmcinnes/umap") + (synopsis + "Uniform Manifold Approximation and Projection") + (description + "Uniform Manifold Approximation and Projection is a dimension reduction +technique that can be used for visualisation similarly to t-SNE, but also for +general non-linear dimension reduction.") + (license license:bsd-3)))