diff options
author | Maxim Cournoyer <maxim.cournoyer@gmail.com> | 2022-01-25 22:07:13 -0500 |
---|---|---|
committer | Maxim Cournoyer <maxim.cournoyer@gmail.com> | 2022-01-25 22:07:13 -0500 |
commit | 1a5302435ff0d2822b823f5a6fe01faa7a85c629 (patch) | |
tree | ac7810c88b560532f22d2bab2e59609cd7305c21 /gnu/packages/machine-learning.scm | |
parent | 3ff2ac4980dacf10087e4b42bd9fbc490591900c (diff) | |
parent | 070b8a893febd6e7d8b2b7c8c4dcebacf7845aa9 (diff) |
Merge branch 'master' into staging.
With "conflicts" solved (all in favor of master except git) in:
gnu/local.mk
gnu/packages/databases.scm
gnu/packages/glib.scm
gnu/packages/gnome.scm
gnu/packages/gnupg.scm
gnu/packages/gnuzilla.scm
gnu/packages/graphics.scm
gnu/packages/gstreamer.scm
gnu/packages/gtk.scm
gnu/packages/linux.scm
gnu/packages/machine-learning.scm
gnu/packages/networking.scm
gnu/packages/polkit.scm
gnu/packages/pulseaudio.scm
gnu/packages/rpc.scm
gnu/packages/rust.scm
gnu/packages/version-control.scm
gnu/packages/w3m.scm
Diffstat (limited to 'gnu/packages/machine-learning.scm')
-rw-r--r-- | gnu/packages/machine-learning.scm | 825 |
1 files changed, 477 insertions, 348 deletions
diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm index 1a17c73eea..aac5b81a06 100644 --- a/gnu/packages/machine-learning.scm +++ b/gnu/packages/machine-learning.scm @@ -15,7 +15,7 @@ ;;; Copyright © 2019 Brett Gilio <brettg@gnu.org> ;;; Copyright © 2020 Konrad Hinsen <konrad.hinsen@fastmail.net> ;;; Copyright © 2020 Edouard Klein <edk@beaver-labs.com> -;;; Copyright © 2020, 2021 Vinicius Monego <monego@posteo.net> +;;; Copyright © 2020, 2021, 2022 Vinicius Monego <monego@posteo.net> ;;; Copyright © 2020, 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com> ;;; ;;; This file is part of GNU Guix. @@ -35,6 +35,7 @@ (define-module (gnu packages machine-learning) #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix gexp) #:use-module (guix packages) #:use-module (guix utils) #:use-module (guix download) @@ -53,6 +54,7 @@ #:use-module (gnu packages base) #:use-module (gnu packages bash) #:use-module (gnu packages boost) + #:use-module (gnu packages bdw-gc) #:use-module (gnu packages check) #:use-module (gnu packages compression) #:use-module (gnu packages cmake) @@ -61,10 +63,16 @@ #:use-module (gnu packages databases) #:use-module (gnu packages dejagnu) #:use-module (gnu packages gcc) + #:use-module (gnu packages gettext) + #:use-module (gnu packages gl) #:use-module (gnu packages glib) #:use-module (gnu packages graphviz) #:use-module (gnu packages gstreamer) + #:use-module (gnu packages guile) + #:use-module (gnu packages haskell-xyz) #:use-module (gnu packages image) + #:use-module (gnu packages image-processing) + #:use-module (gnu packages imagemagick) #:use-module (gnu packages libffi) #:use-module (gnu packages linux) #:use-module (gnu packages llvm) @@ -77,6 +85,7 @@ #:use-module (gnu packages perl) #:use-module (gnu packages pkg-config) #:use-module (gnu packages protobuf) + #:use-module (gnu packages pulseaudio) #:use-module (gnu packages python) #:use-module (gnu packages python-build) #:use-module (gnu packages python-check) @@ -90,6 +99,7 @@ #:use-module (gnu packages sqlite) #:use-module (gnu packages swig) #:use-module (gnu packages tls) + #:use-module (gnu packages video) #:use-module (gnu packages web) #:use-module (gnu packages xml) #:use-module (gnu packages xorg) @@ -141,20 +151,28 @@ sparsely connected networks.") (build-system gnu-build-system) (arguments `(#:tests? #f ; no "check" target - #:phases (modify-phases %standard-phases - (delete 'configure) - (replace - 'install ; no ‘install’ target - (lambda* (#:key outputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (bin (string-append out "/bin/"))) - (mkdir-p bin) - (for-each (lambda (file) - (copy-file file (string-append bin file))) - '("svm-train" - "svm-predict" - "svm-scale"))) - #t))))) + #:phases + (modify-phases %standard-phases + (delete 'configure) + (add-after 'build 'build-lib + (lambda _ + (invoke "make" "lib"))) + (replace 'install ; no ‘install’ target + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (bin (string-append out "/bin/")) + (lib (string-append out "/lib/")) + (inc (string-append out "/include/libsvm"))) + (mkdir-p bin) + (for-each (lambda (file) + (copy-file file (string-append bin file))) + '("svm-train" + "svm-predict" + "svm-scale")) + (mkdir-p lib) + (install-file "libsvm.so.2" lib) + (mkdir-p inc) + (install-file "svm.h" inc))))))) (home-page "https://www.csie.ntu.edu.tw/~cjlin/libsvm/") (synopsis "Library for Support Vector Machines") (description @@ -193,7 +211,7 @@ classification.") (string-append site "libsvm.so.2"))) #t))))) (inputs - `(("python" ,python))) + (list python)) (synopsis "Python bindings of libSVM"))) (define-public ghmm @@ -222,20 +240,7 @@ classification.") #:phases (modify-phases %standard-phases (add-after 'unpack 'enter-dir - (lambda _ (chdir "ghmm") #t)) - (delete 'check) - (add-after 'install 'check - (assoc-ref %standard-phases 'check)) - (add-before 'check 'fix-PYTHONPATH - (lambda* (#:key inputs outputs #:allow-other-keys) - (let ((python-version (python-version - (assoc-ref inputs "python")))) - (setenv "PYTHONPATH" - (string-append (getenv "PYTHONPATH") - ":" (assoc-ref outputs "out") - "/lib/python" python-version - "/site-packages"))) - #t)) + (lambda _ (chdir "ghmm"))) (add-after 'enter-dir 'fix-runpath (lambda* (#:key outputs #:allow-other-keys) (substitute* "ghmmwrapper/setup.py" @@ -246,8 +251,7 @@ classification.") line "\"-Wl,-rpath=" (assoc-ref outputs "out") - "/lib\", "))) - #t)) + "/lib\", "))))) (add-after 'enter-dir 'disable-broken-tests (lambda _ (substitute* "tests/Makefile.am" @@ -267,18 +271,17 @@ classification.") line indent) (string-append indent "@unittest.skip(\"Disabled by Guix\")\n" - line))) - #t))))) + line)))))))) (inputs `(("python" ,python-2) ; only Python 2 is supported ("libxml2" ,libxml2))) (native-inputs - `(("pkg-config" ,pkg-config) - ("dejagnu" ,dejagnu) - ("swig" ,swig) - ("autoconf" ,autoconf) - ("automake" ,automake) - ("libtool" ,libtool))) + (list pkg-config + dejagnu + swig + autoconf + automake + libtool)) (home-page "http://ghmm.org") (synopsis "Hidden Markov Model library") (description @@ -288,6 +291,149 @@ Markov Models} (HMM) and algorithms: discrete, continuous emissions, basic training, HMM clustering, HMM mixtures.") (license license:lgpl2.0+)))) +(define-public guile-aiscm + (package + (name "guile-aiscm") + (version "0.23.1") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/wedesoft/aiscm") + (commit "c78b91edb7c17c6fbf3b294452f44e91d75e3c67"))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "09rdbcr8dinzijyx9h940ann91yjlbg0fangx365llhvy354n840")))) + (build-system gnu-build-system) + (arguments + (list + #:make-flags + #~(list (string-append "GUILE_CACHE=" #$output "/lib/guile/3.0/site-ccache") + (string-append "GUILE_EXT=" #$output "/lib/guile/3.0/extensions") + (string-append "GUILE_SITE=" #$output "/share/guile/site/3.0")) + #:phases + '(modify-phases %standard-phases + (add-after 'unpack 'build-reproducibly + (lambda _ + (substitute* "doc/Makefile.am" + (("\\$\\(DATE\\)") "1970-01-01")))) + (add-after 'unpack 'use-llvm-config + (lambda _ + (substitute* "m4/ax_llvmc.m4" + (("llvm-config-13") "llvm-config") + ;; For some reason this library is not on the link list. + (("(LLVM_LIBS=\"\\$\\(\\$ac_llvm_config_path --libs \\$1\\))\"" _ m) + (string-append m " -lLLVMMCJIT\""))) + + ;; Because of this message: + ;; symbol lookup error: ./.libs/libguile-aiscm-core.so: undefined symbol: LLVMInitializeX86TargetInfo + ;; This probably needs to differ when building on architectures + ;; other than x86_64p + (substitute* "aiscm/Makefile.am" + (("LLVM_LIBS\\)") "LLVM_LIBS) \ +-lLLVMX86AsmParser -lLLVMX86CodeGen -lLLVMX86Desc -lLLVMX86Info")))) + ;; Use Clang instead of GCC. + (add-before 'configure 'prepare-build-environment + (lambda _ + (setenv "AR" "llvm-ar") + (setenv "NM" "llvm-nm") + (setenv "CC" "clang") + (setenv "CXX" "clang++")))))) + (inputs + (list ffmpeg + freeglut + guile-3.0 + imagemagick + libjpeg-turbo + libomp + libxi + libxmu + libxpm + libxt + libxv + mesa + mjpegtools + pandoc + pulseaudio)) + (native-inputs + (list clang-13 + llvm-13 + pkg-config + autoconf + automake + gettext-minimal + libtool + which)) + (home-page "https://wedesoft.github.io/aiscm/") + (synopsis "Guile extension for numerical arrays and tensors") + (description "AIscm is a Guile extension for numerical arrays and tensors. +Performance is achieved by using the LLVM JIT compiler.") + (license license:gpl3+))) + +(define-public guile-aiscm-next + (let ((commit "b17ed538c303badc419a7c358d91f266d2a8c354") + (revision "1")) + (package + (inherit guile-aiscm) + (name "guile-aiscm-next") + (version (git-version "0.23.1" revision commit)) + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/wedesoft/aiscm") + (commit commit))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0px7r7lfskbp1prdrfrcvrsc4wjrk3ahkigsw4pqvny6zs7jnvc0")))) + (arguments + (substitute-keyword-arguments (package-arguments guile-aiscm) + ((#:configure-flags flags '()) + #~(list (string-append "OPENCV_CFLAGS=-I" #$(this-package-input "opencv") + "/include/opencv4") + (let ((modules + (list "aruco" "barcode" "bgsegm" "bioinspired" + "calib3d" "ccalib" "core" "datasets" "dnn" + "dnn_objdetect" "dnn_superres" "dpm" "face" + "features2d" "flann" "freetype" "fuzzy" "hdf" + "hfs" "highgui" "img_hash" "imgcodecs" "imgproc" + "intensity_transform" "line_descriptor" "mcc" + "ml" "objdetect" "optflow" "phase_unwrapping" + "photo" "plot" "quality" "rapid" "reg" "rgbd" + "saliency" "shape" "stereo" "stitching" + "structured_light" "superres" "surface_matching" + "text" "tracking" "video" "videoio" "videostab" + "wechat_qrcode" "ximgproc" "xobjdetect" "xphoto"))) + (format #false "OPENCV_LIBS=~{-lopencv_~a~^ ~}" modules)))) + ((#:phases phases '%standard-phases) + `(modify-phases ,phases + (add-after 'unpack 'find-clearsilver + (lambda* (#:key inputs #:allow-other-keys) + (substitute* "configure.ac" + (("/usr/local/include/ClearSilver") + (string-append (assoc-ref inputs "clearsilver") + "/include/ClearSilver"))) + (substitute* "aiscm/Makefile.am" + (("-lneo_utl" m) + (string-append m " -lstreamhtmlparser"))) + (setenv "C_INCLUDE_PATH" + (string-append (assoc-ref inputs "clearsilver") + "/include/ClearSilver:" + (or (getenv "C_INCLUDE_PATH") ""))))) + ;; This test fails because our version of tensorflow is too old + ;; to provide tf-string-length. + (add-after 'unpack 'disable-broken-test + (lambda _ + (substitute* "tests/test_tensorflow.scm" + (("\\(test-eqv \"determine string length" m) + (string-append "#;" m))))))))) + (inputs + (modify-inputs (package-inputs guile-aiscm) + (append clearsilver opencv tensorflow libgc))) + (native-inputs + (modify-inputs (package-native-inputs guile-aiscm) + (append protobuf-c)))))) + (define-public mcl (package (name "mcl") @@ -303,9 +449,10 @@ training, HMM clustering, HMM mixtures.") "15xlax3z31lsn62vlg94hkm75nm40q4679amnfg13jm8m2bnhy5m")))) (build-system gnu-build-system) (arguments - `(#:configure-flags (list "--enable-blast"))) + `(#:configure-flags (list "--enable-blast" + "CFLAGS=-fcommon"))) (inputs - `(("perl" ,perl))) + (list perl)) (home-page "http://micans.org/mcl/") (synopsis "Clustering algorithm for graphs") (description @@ -341,7 +488,7 @@ networks) based on simulation of (stochastic) flow in graphs.") (substitute* "setup.ml" (("LDFLAGS=-fPIC") (string-append "LDFLAGS=-fPIC\"; \"SHELL=" (which "sh"))) - (("-std=c89") "-std=gnu99") + (("-std=c89") "-std=gnu99 -fcommon") ;; This is a mutable string, which is no longer supported. Use ;; a byte buffer instead. @@ -354,14 +501,14 @@ networks) based on simulation of (stochastic) flow in graphs.") ((" s;") " s);")) (substitute* "myocamlbuild.ml" - (("std=c89") "std=gnu99")) + (("std=c89") "std=gnu99 -fcommon")) ;; Since we build with a more recent OCaml, we have to use C99 or ;; later. This causes problems with the old C code. (substitute* "src/impala/matrix.c" (("restrict") "restrict_")) #t))))) (native-inputs - `(("ocamlbuild" ,ocamlbuild))) + (list ocamlbuild)) (home-page "https://github.com/fhcrc/mcl") (synopsis "OCaml wrappers around MCL") (description @@ -391,16 +538,18 @@ algorithm.") (assoc-ref %build-inputs "boost"))) #:phases (modify-phases %standard-phases - (add-before - 'configure 'set-CXXFLAGS - (lambda _ - (setenv "CXXFLAGS" "-fpermissive ") - #t))))) + (add-after 'unpack 'fix-compatibility-errors + (lambda _ + (substitute* "src/library/IAM2WayImportance.h" + (("= std::make_pair.*") + "= std::minmax(varID1, varID2);")) + (substitute* "src/library/DataFrame.h" + (("isFirst\\?.*") + "if (isFirst) { isFirst = false; } else { os << par.delimiter; }\n")))) + (add-before 'configure 'set-CXXFLAGS + (lambda _ (setenv "CXXFLAGS" "-fpermissive ")))))) (inputs - `(("boost" ,boost) - ("gsl" ,gsl) - ("libxml2" ,libxml2) - ("zlib" ,zlib))) + (list boost gsl libxml2 zlib)) (native-inputs `(("gfortran" ,gfortran) ("gfortran:lib" ,gfortran "lib"))) @@ -570,8 +719,7 @@ optimizing, and searching weighted finite-state transducers (FSTs).") ("lzo" ,lzo) ("zlib" ,zlib))) (native-inputs - `(("pkg-config" ,pkg-config) - ("rxcpp" ,rxcpp))) + (list pkg-config rxcpp)) ;; Non-portable SSE instructions are used so building fails on platforms ;; other than x86_64. (supported-systems '("x86_64-linux")) @@ -648,22 +796,18 @@ in terms of new algorithms.") (invoke "make" "install" "-C" ".setuptools-cmake-build")))))) (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))) + (list cmake + googletest + pybind11 + python-coverage + python-nbval + python-pytest + python-pytest-runner)) (inputs - `(("protobuf" ,protobuf))) + (list 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))) + (list python-numpy python-protobuf python-six python-tabulate + python-typing-extensions)) (home-page "https://onnx.ai/") (synopsis "Open Neural Network Exchange") (description @@ -700,17 +844,12 @@ standard data types.") (build-system python-build-system) (arguments (package-arguments onnx)) ;reuse build system tweaks (native-inputs - `(("cmake" ,cmake) - ("python-pytest" ,python-pytest) - ("python-pytest-runner" ,python-pytest-runner) - ("python-nbval" ,python-nbval) - ("python-coverage" ,python-coverage))) + (list cmake python-pytest python-pytest-runner python-nbval + python-coverage)) (inputs - `(("onnx" ,onnx) - ("protobuf" ,protobuf) - ("pybind11" ,pybind11))) + (list onnx protobuf pybind11)) (propagated-inputs - `(("python-numpy" ,python-numpy))) + (list python-numpy)) (synopsis "Library to optimize ONNX models") (description "This package provides a C++ and Python library for performing arbitrary @@ -749,7 +888,7 @@ with a single function call.") (lambda _ (invoke "ctest")))))) (native-inputs - `(("catch" ,catch-framework))) + (list catch-framework)) (home-page "http://reactivex.io/") (synopsis "Reactive Extensions for C++") (description @@ -854,7 +993,7 @@ than 8 bits, and at the end only some significant 8 bits are kept.") '("meta" "profiling" "public" "fixedpoint" "eight_bit_int_gemm" "internal"))))))))) (native-inputs - `(("unzip" ,unzip))) + (list unzip)) (properties '((hidden? . #t)))))) (define-public dlib @@ -917,9 +1056,9 @@ than 8 bits, and at the end only some significant 8 bits are kept.") (invoke "./dtest" "--runall")) #t)))))) (native-inputs - `(("pkg-config" ,pkg-config) - ;; For tests. - ("libnsl" ,libnsl))) + (list pkg-config + ;; For tests. + libnsl)) (inputs `(("giflib" ,giflib) ("lapack" ,lapack) @@ -941,7 +1080,7 @@ computing environments.") (define-public python-scikit-learn (package (name "python-scikit-learn") - (version "0.24.2") + (version "1.0.2") (source (origin (method git-fetch) @@ -951,7 +1090,7 @@ computing environments.") (file-name (git-file-name name version)) (sha256 (base32 - "0hm92biqwwc87bqnr56lwa5bz77lr7k9q21rdwksnfzq3vsdp2nm")))) + "1rli53544vlsnmx4v4xcb8fdqcy5n3zksl4plwp76gsmrppb2lig")))) (build-system python-build-system) (arguments `(#:phases @@ -959,32 +1098,24 @@ computing environments.") (add-after 'build 'build-ext (lambda _ (invoke "python" "setup.py" "build_ext" "--inplace"))) (replace 'check - (lambda _ - ;; Restrict OpenBLAS threads to prevent segfaults while testing! - (setenv "OPENBLAS_NUM_THREADS" "1") + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + ;; Restrict OpenBLAS threads to prevent segfaults while testing! + (setenv "OPENBLAS_NUM_THREADS" "1") - ;; Some tests require write access to $HOME. - (setenv "HOME" "/tmp") + ;; Some tests require write access to $HOME. + (setenv "HOME" "/tmp") - (invoke "pytest" "sklearn" "-m" "not network"))) - (add-before 'reset-gzip-timestamps 'make-files-writable - (lambda* (#:key outputs #:allow-other-keys) - ;; Make sure .gz files are writable so that the - ;; 'reset-gzip-timestamps' phase can do its work. - (let ((out (assoc-ref outputs "out"))) - (for-each make-file-writable - (find-files out "\\.gz$")))))))) + (invoke "pytest" "sklearn" "-m" "not network" + ;; This test tries to access the internet. + "-k" "not test_load_boston_alternative"))))))) (inputs - `(("openblas" ,openblas))) + (list openblas)) (native-inputs - `(("python-pytest" ,python-pytest) - ("python-pandas" ,python-pandas) ;for tests - ("python-cython" ,python-cython))) + (list python-pytest python-pandas ;for tests + python-cython)) (propagated-inputs - `(("python-numpy" ,python-numpy) - ("python-threadpoolctl" ,python-threadpoolctl) - ("python-scipy" ,python-scipy) - ("python-joblib" ,python-joblib))) + (list python-numpy python-threadpoolctl python-scipy python-joblib)) (home-page "https://scikit-learn.org/") (synopsis "Machine Learning in Python") (description @@ -1009,16 +1140,35 @@ data analysis.") (sha256 (base32 "08zbzi8yx5wdlxfx9jap61vg1malc9ajf576w7a0liv6jvvrxlpj")))) + (arguments + `(#:python ,python-2 + #:phases + (modify-phases %standard-phases + (add-after 'build 'build-ext + (lambda _ (invoke "python" "setup.py" "build_ext" "--inplace"))) + (replace 'check + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + ;; Restrict OpenBLAS threads to prevent segfaults while testing! + (setenv "OPENBLAS_NUM_THREADS" "1") + + ;; Some tests require write access to $HOME. + (setenv "HOME" "/tmp") + + (invoke "pytest" "sklearn" "-m" "not network" + "-k" + (string-append + ;; This test tries to access the internet. + "not test_load_boston_alternative" + ;; This test fails for unknown reasons + " and not test_rank_deficient_design")))))))) (inputs - `(("openblas" ,openblas))) + (list openblas)) (native-inputs - `(("python2-pytest" ,python2-pytest) - ("python2-pandas" ,python2-pandas) ;for tests - ("python2-cython" ,python2-cython))) + (list python2-pytest python2-pandas ;for tests + python2-cython)) (propagated-inputs - `(("python2-numpy" ,python2-numpy) - ("python2-scipy" ,python2-scipy) - ("python2-joblib" ,python2-joblib)))))) + (list python2-numpy python2-scipy python2-joblib))))) (define-public python-threadpoolctl (package @@ -1042,7 +1192,7 @@ data analysis.") (invoke "pytest")) #t))))) (native-inputs - `(("python-pytest" ,python-pytest))) + (list python-pytest)) (home-page "https://github.com/joblib/threadpoolctl") (synopsis "Python helpers for common threading libraries") (description "Thread-pool Controls provides Python helpers to limit the @@ -1053,22 +1203,27 @@ for scientific computing and data science (e.g. BLAS and OpenMP).") (define-public python-pynndescent (package (name "python-pynndescent") - (version "0.5.2") + (version "0.5.5") (source (origin (method url-fetch) (uri (pypi-uri "pynndescent" version)) (sha256 - (base32 "0w87c2v0li2rdbx6qfc2lb6y6bxpdy3jwfgzfs1kcr4d1chj5zfr")))) + (base32 "10pqqqc3jkpw03cyzy04slxmpgyhqnlgbyk0c1cv7kqr5d0zhzbs")))) (build-system python-build-system) + (arguments + `(#:phases + (modify-phases %standard-phases + (replace 'check + (lambda* (#:key inputs outputs tests? #:allow-other-keys) + (when tests? + (add-installed-pythonpath inputs outputs) + (invoke "python" "-m" "pytest" "--pyargs" "pynndescent"))))))) (native-inputs - `(("python-nose" ,python-nose))) + (list python-pytest)) (propagated-inputs - `(("python-joblib" ,python-joblib) - ("python-llvmlite" ,python-llvmlite) - ("python-numba" ,python-numba) - ("python-scikit-learn" ,python-scikit-learn) - ("python-scipy" ,python-scipy))) + (list python-joblib python-llvmlite python-numba python-scikit-learn + python-scipy)) (home-page "https://github.com/lmcinnes/pynndescent") (synopsis "Nearest neighbor descent for approximate nearest neighbors") (description @@ -1079,17 +1234,16 @@ for k-neighbor-graph construction and approximate nearest neighbor search.") (define-public python-opentsne (package (name "python-opentsne") - (version "0.5.2") + (version "0.6.1") (source (origin - ;; No tests in the PyPI tarball. - (method git-fetch) + (method git-fetch) ; no tests in PyPI release (uri (git-reference (url "https://github.com/pavlin-policar/openTSNE") (commit (string-append "v" version)))) - (file-name (string-append name "-" version "-checkout")) + (file-name (git-file-name name version)) (sha256 - (base32 "1hl42wmafydk4fxdx05l180k3canmqw8h9r20fsqq2aq440b09gh")))) + (base32 "124nid27lfq1ipfjd2gkynqcmb4khisjb4r05jv42ckfkk4dbsxs")))) (build-system python-build-system) (arguments `(#:phases @@ -1097,22 +1251,22 @@ for k-neighbor-graph construction and approximate nearest neighbor search.") ;; Benchmarks require the 'macosko2015' data files. (add-after 'unpack 'delete-benchmark (lambda _ - (delete-file-recursively "benchmarks") - #t)) + (delete-file-recursively "benchmarks"))) + (add-after 'unpack 'skip-test + (lambda _ ;; TODO: figure out why this test fails. + (substitute* "tests/test_correctness.py" + (("def test_iris\\(self\\)") "def _test_iris(self)")))) ;; Numba needs a writable dir to cache functions. (add-before 'check 'set-numba-cache-dir (lambda _ - (setenv "NUMBA_CACHE_DIR" "/tmp") - #t))))) + (setenv "NUMBA_CACHE_DIR" "/tmp")))))) (native-inputs - `(("python-cython" ,python-cython))) + (list python-cython)) (inputs - `(("fftw" ,fftw))) + (list fftw)) (propagated-inputs - `(("python-numpy" ,python-numpy) - ("python-pynndescent" ,python-pynndescent) - ("python-scikit-learn" ,python-scikit-learn) - ("python-scipy" ,python-scipy))) + (list python-numpy python-pynndescent python-scikit-learn + python-scipy)) (home-page "https://github.com/pavlin-policar/openTSNE") (synopsis "Extensible, parallel implementations of t-SNE") (description @@ -1124,22 +1278,17 @@ visualizing high-dimensional data sets.") (define-public python-scikit-rebate (package (name "python-scikit-rebate") - (version "0.6") + (version "0.62") (source (origin (method url-fetch) (uri (pypi-uri "skrebate" version)) (sha256 (base32 - "1h7qs9gjxpzqabzhb8rmpv3jpmi5iq41kqdibg48299h94iikiw7")))) + "0n55ghvnv7rxqa5agq6a4892ad0ghha165b0g4ghwr9gqm6ss3dj")))) (build-system python-build-system) - ;; Pandas is only needed to run the tests. - (native-inputs - `(("python-pandas" ,python-pandas))) + (arguments '(#:tests? #f)) ;no tests on PyPI and no tags in repo (propagated-inputs - `(("python-numpy" ,python-numpy) - ("python-scipy" ,python-scipy) - ("python-scikit-learn" ,python-scikit-learn) - ("python-joblib" ,python-joblib))) + (list python-numpy python-scipy python-scikit-learn 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 @@ -1165,10 +1314,10 @@ standard feature selection algorithms.") (file-name (git-file-name name version)))) (build-system python-build-system) (native-inputs - `(("python-setuptools" ,python-setuptools) ;build fails without this - ("python-wheel" ,python-wheel))) + (list python-setuptools ;build fails without this + python-wheel)) (propagated-inputs - `(("python-numpy" ,python-numpy))) + (list python-numpy)) (home-page "https://github.com/CyberAgent/cmaes") (synopsis "CMA-ES implementation for Python") (description "This package provides provides an implementation of the @@ -1194,11 +1343,9 @@ Covariance Matrix Adaptation Evolution Strategy (CMA-ES) for Python.") (version version) (build-system python-build-system) (native-inputs - `(("python-nose" ,python-nose) - ("python-pytest" ,python-pytest))) + (list python-nose python-pytest)) (propagated-inputs - `(("python-future" ,python-future) - ("python-numpy" ,python-numpy))) + (list python-future python-numpy)) (arguments `(#:phases (modify-phases %standard-phases (replace 'check @@ -1232,13 +1379,11 @@ main intended application of Autograd is gradient-based optimization.") "0jlvyn7k81dzrh9ij3zw576wbgiwmmr26rzpdxjn1dbpc3njpvzi")) (file-name (git-file-name name version)))) (native-inputs - `(("python-pytest" ,python-pytest) - ("python-nose" ,python-nose))) + (list python-pytest python-nose)) (inputs - `(("openmpi" ,openmpi))) + (list openmpi)) (propagated-inputs - `(("python-numpy" ,python-numpy) - ("python-scipy" ,python-scipy))) + (list python-numpy python-scipy)) (arguments `(#:configure-flags '("-DUSE_MPI=ON") @@ -1279,8 +1424,7 @@ the following advantages: "04bwzk6ifgnz3fmzid8b7avxf9n5pnx9xcjm61nkjng1vv0bpj8x")) (file-name (git-file-name name version)))) (inputs - `(("boost" ,boost) - ("zlib" ,zlib))) + (list boost zlib)) (arguments `(#:configure-flags (list (string-append "--with-boost=" @@ -1323,17 +1467,14 @@ interactive learning.") `(#:tests? #f ; some test files are missing #:python ,python-2)) ; only Python 2.7 is supported (propagated-inputs - `(("python2-numpy" ,python2-numpy) - ("python2-scipy" ,python2-scipy) - ("python2-matplotlib" ,python2-matplotlib) - ("python2-pandas" ,python2-pandas) - ("python2-scikit-learn" ,python2-scikit-learn) - ("python2-pysnptools" ,python2-pysnptools))) + (list python2-numpy + python2-scipy + python2-matplotlib + python2-pandas + python2-scikit-learn + python2-pysnptools)) (native-inputs - `(("unzip" ,unzip) - ("python2-cython" ,python2-cython) - ("python2-mock" ,python2-mock) - ("python2-nose" ,python2-nose))) + (list unzip python2-cython python2-mock python2-nose)) (home-page "http://research.microsoft.com/en-us/um/redmond/projects/mscompbio/fastlmm/") (synopsis "Perform genome-wide association studies on large data sets") (description @@ -1372,20 +1513,20 @@ association studies (GWAS) on extremely large data sets.") " and not test_quadratic1" " and not test_twoarms")))))))) (propagated-inputs - `(("python-cloudpickle" ,python-cloudpickle) - ("python-future" ,python-future) - ("python-networkx" ,python-networkx) - ("python-numpy" ,python-numpy) - ("python-scipy" ,python-scipy) - ("python-six" ,python-six) - ("python-tqdm" ,python-tqdm))) + (list python-cloudpickle + python-future + python-networkx + python-numpy + python-scipy + python-six + python-tqdm)) (native-inputs - `(("python-black" ,python-black) - ("python-ipython" ,python-ipython) - ("python-ipyparallel" ,python-ipyparallel) - ("python-nose" ,python-nose) - ("python-pymongo" ,python-pymongo) - ("python-pytest" ,python-pytest))) + (list python-black + python-ipython + python-ipyparallel + python-nose + python-pymongo + python-pytest)) (home-page "https://hyperopt.github.io/hyperopt/") (synopsis "Library for hyperparameter optimization") (description "Hyperopt is a Python library for serial and parallel @@ -1484,21 +1625,21 @@ discrete, and conditional dimensions.") (string-append lib "/gstreamer-1.0")) #t)))))) (inputs - `(("alsa-lib" ,alsa-lib) - ("gfortran" ,gfortran "lib") - ("glib" ,glib) - ("gstreamer" ,gstreamer) - ("jack" ,jack-1) - ("openblas" ,openblas) - ("openfst" ,openfst) - ("portaudio" ,portaudio) - ("python" ,python))) + (list alsa-lib + `(,gfortran "lib") + glib + gstreamer + jack-1 + openblas + openfst + portaudio + python)) (native-inputs - `(("glib" ,glib "bin") ; glib-genmarshal - ("grep" ,grep) - ("sed" ,sed) - ("pkg-config" ,pkg-config) - ("which" ,which))) + (list `(,glib "bin") ; glib-genmarshal + grep + sed + pkg-config + which)) (home-page "https://kaldi-asr.org/") (synopsis "Speech recognition toolkit") (description "Kaldi is an extensible toolkit for speech recognition @@ -1558,11 +1699,7 @@ written in C++.") (install-file "libgstkaldinnet2onlinedecoder.so" lib) #t)))))) (inputs - `(("glib" ,glib) - ("gstreamer" ,gstreamer) - ("jansson" ,jansson) - ("openfst" ,openfst) - ("kaldi" ,kaldi))) + (list glib gstreamer jansson openfst kaldi)) (native-inputs `(("bash" ,bash) ("glib:bin" ,glib "bin") ; glib-genmarshal @@ -1642,7 +1779,7 @@ automatically.") (let* ((server (string-append bin "/kaldi-gst-server")) (client (string-append bin "/kaldi-gst-client")) (worker (string-append bin "/kaldi-gst-worker")) - (PYTHONPATH (getenv "PYTHONPATH")) + (PYTHONPATH (getenv "GUIX_PYTHONPATH")) (GST_PLUGIN_PATH (string-append (assoc-ref inputs "gst-kaldi-nnet2-online") "/lib/gstreamer-1.0:${GST_PLUGIN_PATH}")) @@ -1651,7 +1788,7 @@ automatically.") (lambda _ (format #t "#!~a -export PYTHONPATH=~a +export GUIX_PYTHONPATH=~a export GST_PLUGIN_PATH=~a exec ~a ~a/~a \"$@\"~%" (which "bash") PYTHONPATH GST_PLUGIN_PATH @@ -1695,7 +1832,9 @@ Python.") (file-name (string-append "tensorflow-" version "-checkout")) (sha256 (base32 - "0a9kwha395g3wgxfwln5j8vn9nkspmd75xldrlqdq540w996g8xa")))) + "0a9kwha395g3wgxfwln5j8vn9nkspmd75xldrlqdq540w996g8xa")) + (patches + (search-patches "tensorflow-c-api-fix.patch")))) (build-system cmake-build-system) (arguments `(#:tests? #f ; no "check" target @@ -1755,9 +1894,9 @@ Python.") ;; SOURCE_DATE_EPOCH is respected, which we set to some time in ;; 1980. (lambda _ (setenv "SOURCE_DATE_EPOCH" "315532800") #t)) - ;; See https://github.com/tensorflow/tensorflow/issues/20517#issuecomment-406373913 - (add-after 'unpack 'python3.7-compatibility + (add-after 'unpack 'python3.9-compatibility (lambda _ + ;; See https://github.com/tensorflow/tensorflow/issues/20517#issuecomment-406373913 (substitute* '("tensorflow/python/eager/pywrap_tfe_src.cc" "tensorflow/python/lib/core/ndarray_tensor.cc" "tensorflow/python/lib/core/py_func.cc") @@ -1775,9 +1914,17 @@ Python.") ;; https://github.com/tensorflow/tensorflow/issues/34197 (substitute* (find-files "tensorflow/python" ".*\\.cc$") (("(nullptr,)(\\ +/. tp_print)" _ _ tp_print) - (string-append "NULL, " tp_print))))) - (add-after 'python3.7-compatibility 'chdir - (lambda _ (chdir "tensorflow/contrib/cmake") #t)) + (string-append "NULL, " tp_print))) + + ;; Fix the build with numpy >= 1.19. + ;; Suggested in https://github.com/tensorflow/tensorflow/issues/41086#issuecomment-656833081 + (substitute* "tensorflow/python/lib/core/bfloat16.cc" + (("void BinaryUFunc\\(char\\*\\* args, npy_intp\\* dimensions, npy_intp\\* steps,") + "void BinaryUFunc(char** args, npy_intp const* dimensions, npy_intp const* steps,") + (("void CompareUFunc\\(char\\*\\* args, npy_intp\\* dimensions, npy_intp\\* steps,") + "void CompareUFunc(char** args, npy_intp const* dimensions, npy_intp const* steps,")))) + (add-after 'python3.9-compatibility 'chdir + (lambda _ (chdir "tensorflow/contrib/cmake"))) (add-after 'chdir 'disable-downloads (lambda* (#:key inputs #:allow-other-keys) (substitute* (find-files "external" "\\.cmake$") @@ -1792,36 +1939,31 @@ Python.") ;; Sqlite (("include\\(sqlite\\)") "") (("\\$\\{sqlite_STATIC_LIBRARIES\\}") - (string-append (assoc-ref inputs "sqlite") - "/lib/libsqlite3.so")) + (search-input-file inputs "/lib/libsqlite3.so")) (("sqlite_copy_headers_to_destination") "") ;; PNG (("include\\(png\\)") "") (("\\$\\{png_STATIC_LIBRARIES\\}") - (string-append (assoc-ref inputs "libpng") - "/lib/libpng16.so")) + (search-input-file inputs "/lib/libpng16.so")) (("png_copy_headers_to_destination") "") ;; JPEG (("include\\(jpeg\\)") "") (("\\$\\{jpeg_STATIC_LIBRARIES\\}") - (string-append (assoc-ref inputs "libjpeg") - "/lib/libjpeg.so")) + (search-input-file inputs "/lib/libjpeg.so")) (("jpeg_copy_headers_to_destination") "") ;; GIF (("include\\(gif\\)") "") (("\\$\\{gif_STATIC_LIBRARIES\\}") - (string-append (assoc-ref inputs "giflib") - "/lib/libgif.so")) + (search-input-file inputs "/lib/libgif.so")) (("gif_copy_headers_to_destination") "") ;; lmdb (("include\\(lmdb\\)") "") (("\\$\\{lmdb_STATIC_LIBRARIES\\}") - (string-append (assoc-ref inputs "lmdb") - "/lib/liblmdb.so")) + (search-input-file inputs "/lib/liblmdb.so")) (("lmdb_copy_headers_to_destination") "") ;; Protobuf @@ -1875,7 +2017,7 @@ set(eigen_INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR}/external/eigen_archive " ;; This directory is a dependency of many targets. (mkdir-p "protobuf"))) (add-after 'configure 'unpack-third-party-sources - (lambda* (#:key inputs #:allow-other-keys) + (lambda* (#:key inputs outputs #:allow-other-keys) ;; This is needed to configure bundled packages properly. (setenv "CONFIG_SHELL" (which "bash")) (for-each @@ -1913,20 +2055,20 @@ set(eigen_INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR}/external/eigen_archive " "re2")) (rename-file "../build/cub/src/cub/cub-1.8.0/" - "../build/cub/src/cub/cub/"))) + "../build/cub/src/cub/cub/") + + (setenv "LDFLAGS" + (string-append "-Wl,-rpath=" + (assoc-ref outputs "out") "/lib")))) (add-after 'unpack 'fix-python-build (lambda* (#:key inputs outputs #:allow-other-keys) (mkdir-p "protobuf-src") (invoke "tar" "xf" (assoc-ref inputs "protobuf:src") "-C" "protobuf-src" "--strip-components=1") (mkdir-p "eigen-src") - (invoke "tar" "xf" (assoc-ref inputs "eigen:src") - "-C" "eigen-src" "--strip-components=1") + (copy-recursively (assoc-ref inputs "eigen:src") "eigen-src") (substitute* "tensorflow/contrib/cmake/tf_python.cmake" - ;; Ensure that all Python dependencies can be found at build time. - (("PYTHONPATH=\\$\\{CMAKE_CURRENT_BINARY_DIR\\}/tf_python" m) - (string-append m ":" (getenv "PYTHONPATH"))) ;; Take protobuf source files from our source package. (("\\$\\{CMAKE_CURRENT_BINARY_DIR\\}/protobuf/src/protobuf/src/google") (string-append (getcwd) "/protobuf-src/src/google"))) @@ -1938,7 +2080,7 @@ set(eigen_INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR}/external/eigen_archive " (string-append (getcwd) "/eigen-src/")) ;; Take Eigen headers from our own package. (("\\$\\{CMAKE_CURRENT_BINARY_DIR\\}/external/eigen_archive") - (string-append (assoc-ref inputs "eigen") "/include/eigen3"))) + (search-input-directory inputs "/include/eigen3"))) ;; Correct the RUNPATH of ops libraries generated for Python. ;; TODO: this doesn't work :( @@ -1953,11 +2095,21 @@ set(eigen_INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR}/external/eigen_archive " COMPILE_FLAGS ${target_compile_flags} \ INSTALL_RPATH_USE_LINK_PATH TRUE \ INSTALL_RPATH " (assoc-ref outputs "out") "/lib)\n"))))) - (add-after 'build 'build-pip-package + (add-after 'unpack 'patch-cmake-file-to-install-c-headers + (lambda _ + (substitute* "tensorflow/contrib/cmake/tf_c.cmake" + (("if\\(tensorflow_BUILD_PYTHON_BINDINGS" m) + (string-append + "install(DIRECTORY ${tensorflow_source_dir}/tensorflow/c/ \ +DESTINATION include/tensorflow/c FILES_MATCHING PATTERN \"*.h\")\n" m))))) + (add-after 'build 'build-c-bindings + (lambda* (#:key outputs parallel-build? #:allow-other-keys) + (invoke "make" "-j" (if parallel-build? + (number->string (parallel-job-count)) + "1") + "tf_c"))) + (add-after 'install 'build-pip-package (lambda* (#:key outputs parallel-build? #:allow-other-keys) - (setenv "LDFLAGS" - (string-append "-Wl,-rpath=" - (assoc-ref outputs "out") "/lib")) (invoke "make" "-j" (if parallel-build? (number->string (parallel-job-count)) "1") @@ -2338,7 +2490,7 @@ learning libraries.") (define-public xgboost (package (name "xgboost") - (version "1.4.2") + (version "1.5.2") (source (origin (method git-fetch) @@ -2348,7 +2500,7 @@ learning libraries.") (file-name (git-file-name name version)) (patches (search-patches "xgboost-use-system-dmlc-core.patch")) (sha256 - (base32 "00liz816ahk9zj3jv3m2fqwlf6xxfbgvpmpl72iklx32vl192w5d")))) + (base32 "0qx04y7cz8z7qv6bk9q7d7ba9b7xzj53l83l2x9ykdwhzacc3dn0")))) (build-system cmake-build-system) (arguments `(#:configure-flags (list "-DGOOGLE_TEST=ON"))) @@ -2356,7 +2508,7 @@ learning libraries.") `(("googletest" ,googletest) ("python" ,python-wrapper))) (inputs - `(("dmlc-core" ,dmlc-core))) + (list dmlc-core)) (home-page "https://xgboost.ai/") (synopsis "Gradient boosting (GBDT, GBRT or GBM) library") (description @@ -2421,19 +2573,14 @@ in a fast and accurate way.") " and not test_cv_no_shuffle" " and not test_cv" " and not test_training" - ;; FIXME: May pass in the next version. - " and not test_pandas" ;; "'['./runexp.sh']' returned non-zero exit status 1" " and not test_cli_binary_classification")))))))) (native-inputs - `(("python-pandas" ,python-pandas) - ("python-pytest" ,python-pytest) - ("python-scikit-learn" ,python-scikit-learn))) + (list python-pandas python-pytest python-scikit-learn)) (inputs - `(("xgboost" ,xgboost))) + (list xgboost)) (propagated-inputs - `(("python-numpy" ,python-numpy) - ("python-scipy" ,python-scipy))) + (list python-numpy python-scipy)) (synopsis "Python interface for the XGBoost library"))) (define-public python-iml @@ -2449,12 +2596,9 @@ in a fast and accurate way.") "1k8szlpm19rcwcxdny9qdm3gmaqq8akb4xlvrzyz8c2d679aak6l")))) (build-system python-build-system) (propagated-inputs - `(("ipython" ,python-ipython) - ("numpy" ,python-numpy) - ("pandas" ,python-pandas) - ("scipy" ,python-scipy))) + (list python-ipython python-numpy python-pandas python-scipy)) (native-inputs - `(("nose" ,python-nose))) + (list 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, @@ -2479,13 +2623,10 @@ project, and it will potentially also do the same for the Lime project.") ;; The tests require Keras, but this package is needed to build Keras. (arguments '(#:tests? #f)) (propagated-inputs - `(("python-h5py" ,python-h5py) - ("python-numpy" ,python-numpy))) + (list python-h5py python-numpy)) (native-inputs - `(("python-pytest" ,python-pytest) - ("python-pytest-cov" ,python-pytest-cov) - ("python-pytest-pep8" ,python-pytest-pep8) - ("python-pytest-xdist" ,python-pytest-xdist))) + (list python-pytest python-pytest-cov python-pytest-pep8 + python-pytest-xdist)) (home-page "https://github.com/keras-team/keras-applications") (synopsis "Reference implementations of popular deep learning models") (description @@ -2506,15 +2647,14 @@ models for use with the Keras deep learning framework.") "1r98nm4k1svsqjyaqkfk23i31bl1kcfcyp7094yyj3c43phfp3as")))) (build-system python-build-system) (propagated-inputs - `(("python-numpy" ,python-numpy) - ("python-six" ,python-six))) + (list python-numpy python-six)) (native-inputs - `(("python-pandas" ,python-pandas) - ("python-pillow" ,python-pillow) - ("python-pytest" ,python-pytest) - ("python-pytest-cov" ,python-pytest-cov) - ("python-pytest-xdist" ,python-pytest-xdist) - ("tensorflow" ,tensorflow))) + (list python-pandas + python-pillow + python-pytest + python-pytest-cov + python-pytest-xdist + tensorflow)) (home-page "https://github.com/keras-team/keras-preprocessing/") (synopsis "Data preprocessing and augmentation for deep learning models") (description @@ -2570,25 +2710,25 @@ with image data, text data, and sequence data.") ;; recent versions. "and not test_stateful_metrics")))))))) (propagated-inputs - `(("python-h5py" ,python-h5py) - ("python-keras-applications" ,python-keras-applications) - ("python-keras-preprocessing" ,python-keras-preprocessing) - ("python-numpy" ,python-numpy) - ("python-pydot" ,python-pydot) - ("python-pyyaml" ,python-pyyaml) - ("python-scipy" ,python-scipy) - ("python-six" ,python-six) - ("tensorflow" ,tensorflow) - ("graphviz" ,graphviz))) + (list python-h5py + python-keras-applications + python-keras-preprocessing + python-numpy + python-pydot + python-pyyaml + python-scipy + python-six + tensorflow + graphviz)) (native-inputs - `(("python-pandas" ,python-pandas) - ("python-pytest" ,python-pytest) - ("python-pytest-cov" ,python-pytest-cov) - ("python-pytest-pep8" ,python-pytest-pep8) - ("python-pytest-timeout" ,python-pytest-timeout) - ("python-pytest-xdist" ,python-pytest-xdist) - ("python-sphinx" ,python-sphinx) - ("python-requests" ,python-requests))) + (list python-pandas + python-pytest + python-pytest-cov + python-pytest-pep8 + python-pytest-timeout + python-pytest-xdist + python-sphinx + python-requests)) (home-page "https://github.com/keras-team/keras") (synopsis "High-level deep learning framework") (description "Keras is a high-level neural networks API, written in Python @@ -2623,9 +2763,9 @@ that: "1crmqgybzkgkpbmcx16912gsl5qsj49swa0ikx6mhqgph0chrh11")))) (build-system cmake-build-system) (native-inputs - `(("googletest" ,googletest))) + (list googletest)) (inputs - `(("openssl" ,openssl))) + (list openssl)) (arguments `(#:configure-flags '("-DBUILD_TEST=1") #:phases @@ -2655,13 +2795,9 @@ These include a barrier, broadcast, and allreduce.") "02ada2yy6km6zgk2836kg1c97yrcpalvan34p8c57446finnpki1")))) (build-system python-build-system) (native-inputs - `(("python-joblib" ,python-joblib) - ("python-nose" ,python-nose))) + (list python-joblib python-nose)) (propagated-inputs - `(("python-numba" ,python-numba) - ("python-numpy" ,python-numpy) - ("python-scikit-learn" ,python-scikit-learn) - ("python-scipy" ,python-scipy))) + (list python-numba python-numpy python-scikit-learn python-scipy)) (home-page "https://github.com/lmcinnes/umap") (synopsis "Uniform Manifold Approximation and Projection") @@ -2710,16 +2846,14 @@ instead it provides low-level performance primitives leveraged in leading deep learning frameworks, such as PyTorch, Caffe2, MXNet, tiny-dnn, Caffe, Torch, and Darknet.") (inputs - `(("cpuinfo" ,cpuinfo) - ("fp16" ,fp16) - ("fxdiv" ,fxdiv) - ("psimd" ,psimd) - ("pthreadpool" ,pthreadpool) - ("googletest" ,googletest))) + (list cpuinfo + fp16 + fxdiv + psimd + pthreadpool + googletest)) (native-inputs - `(("python" ,python) - ("python-peachpy" ,python-peachpy) - ("python-six" ,python-six))) + (list python python-peachpy python-six)) (license license:bsd-2)))) (define-public xnnpack @@ -2753,13 +2887,13 @@ and Darknet.") ;; another target with the same name already exists. #:tests? #f)) (inputs - `(("cpuinfo" ,cpuinfo) - ("pthreadpool" ,pthreadpool) - ("googletest" ,googletest) - ("googlebenchmark" ,googlebenchmark) - ("fxdiv" ,fxdiv) - ("fp16" ,fp16) - ("psimd" ,psimd))) + (list cpuinfo + pthreadpool + googletest + googlebenchmark + fxdiv + fp16 + psimd)) (synopsis "Optimized floating-point neural network inference operators") (description "XNNPACK is a highly optimized library of floating-point neural network @@ -2773,7 +2907,7 @@ TensorFlow.js, PyTorch, and MediaPipe.") (define-public python-pytorch (package (name "python-pytorch") - (version "1.9.0") + (version "1.10.0") (source (origin (method git-fetch) (uri (git-reference @@ -2783,7 +2917,7 @@ TensorFlow.js, PyTorch, and MediaPipe.") (file-name (git-file-name name version)) (sha256 (base32 - "0cznsh68hwk5761gv7iijb4g6jgjpvs3bbixwpzzmkbkbn2q96c1")) + "1ihsjw48qqbikmhxxn17bcdvk2zsjabvkq61q6pvj7dzvrdpkb60")) (patches (search-patches "python-pytorch-system-libraries.patch" "python-pytorch-runpath.patch")) (modules '((guix build utils))) @@ -2834,13 +2968,10 @@ TensorFlow.js, PyTorch, and MediaPipe.") (lambda* (#:key inputs outputs tests? #:allow-other-keys) ;; Run the test suite following the instructions in ;; 'CONTRIBUTING.md'. XXX: Unfortunately this doesn't - ;; work, unless you set PYTHONPATH presumably. + ;; work, unless you set GUIX_PYTHONPATH presumably. (when tests? - (let ((python-site (site-packages inputs outputs))) - (setenv "PYTHONPATH" - (string-append python-site ":" - (getenv "PYTHONPATH"))) - (invoke "python" "test/run_test.py"))))) + (add-installed-pythonpath inputs outputs) + (invoke "python" "test/run_test.py")))) (add-after 'install 'remove-test-executables (lambda* (#:key inputs outputs #:allow-other-keys) ;; Remove test executables, but keep other executables @@ -2853,39 +2984,40 @@ TensorFlow.js, PyTorch, and MediaPipe.") ;; XXX: Tests attempt to download data such as ;; <https://raw.githubusercontent.com/pytorch/test-infra/master/stats/slow-tests.json>. + ;; We're also missing some Python modules, such as expecttest. #:tests? #f)) (native-inputs - `(("cmake" ,cmake) - ("ninja" ,ninja))) + (list cmake ninja)) (inputs - `(("eigen" ,eigen) - ;; ("fmt" ,fmt) - ("fp16" ,fp16) - ("gemmlowp" ,gemmlowp) - ("googletest" ,googletest) - ("googlebenchmark" ,googlebenchmark) - ("gloo" ,gloo) - ("nnpack" ,nnpack) - ("openblas" ,openblas) - ("openmpi" ,openmpi) - ("pthreadpool" ,pthreadpool) - ("protobuf" ,protobuf) - ("pybind11" ,pybind11) - ("sleef" ,sleef) - ("xnnpack" ,xnnpack) - ("zstd" ,zstd))) + (list eigen + ;; ("fmt" ,fmt) + fp16 + gemmlowp + googletest + googlebenchmark + gloo + nnpack + openblas + openmpi + pthreadpool + protobuf + pybind11 + sleef + xnnpack + zstd)) (propagated-inputs - `(("python-astunparse" ,python-astunparse) - ("python-numpy" ,python-numpy) - ("python-pyyaml" ,python-pyyaml) - ("python-cffi" ,python-cffi) - ("python-typing-extensions" ,python-typing-extensions) - ("python-future" ,python-future) - ("python-six" ,python-six) - ("python-requests" ,python-requests) - ("onnx" ,onnx) ;propagated for its Python modules - ("onnx-optimizer" ,onnx-optimizer) - ("cpuinfo" ,cpuinfo))) + (list python-astunparse + python-click + python-numpy + python-pyyaml + python-cffi + python-typing-extensions + python-future + python-six + python-requests + onnx ;propagated for its Python modules + onnx-optimizer + cpuinfo)) (home-page "https://pytorch.org/") (synopsis "Python library for tensor computation and deep neural networks") (description @@ -2924,13 +3056,10 @@ Note: currently this package does not provide GPU support.") (with-directory-excursion (string-append (assoc-ref outputs "out") "/lib") (invoke "python" "-m" "pytest")))))))) (propagated-inputs - `(("python-cython" ,python-cython) - ("python-numpy" ,python-numpy) - ("python-scikit-learn" ,python-scikit-learn) - ("python-scipy" ,python-scipy) - ("python-setuptools-scm" ,python-setuptools-scm))) + (list python-cython python-numpy python-scikit-learn python-scipy + python-setuptools-scm)) (native-inputs - `(("python-pytest" ,python-pytest))) + (list python-pytest)) (home-page "https://github.com/hmmlearn/hmmlearn") (synopsis "Hidden Markov Models with scikit-learn like API") (description |