1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020 Ricardo Wurmus <rekado@elephly.net>
3 ;;; Copyright © 2016, 2020 Efraim Flashner <efraim@flashner.co.il>
4 ;;; Copyright © 2016, 2017, 2020 Marius Bakke <mbakke@fastmail.com>
5 ;;; Copyright © 2016 Hartmut Goebel <h.goebel@crazy-compilers.com>
6 ;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
7 ;;; Copyright © 2018 Kei Kebreau <kkebreau@posteo.net>
8 ;;; Copyright © 2018 Mark Meyer <mark@ofosos.org>
9 ;;; Copyright © 2018 Ben Woodcroft <donttrustben@gmail.com>
10 ;;; Copyright © 2018 Fis Trivial <ybbs.daans@hotmail.com>
11 ;;; Copyright © 2018 Julien Lepiller <julien@lepiller.eu>
12 ;;; Copyright © 2018 Björn Höfling <bjoern.hoefling@bjoernhoefling.de>
13 ;;; Copyright © 2019 Nicolas Goaziou <mail@nicolasgoaziou.fr>
14 ;;; Copyright © 2019 Guillaume Le Vaillant <glv@posteo.net>
15 ;;; Copyright © 2019 Brett Gilio <brettg@gnu.org>
16 ;;; Copyright © 2020 Konrad Hinsen <konrad.hinsen@fastmail.net>
18 ;;; This file is part of GNU Guix.
20 ;;; GNU Guix is free software; you can redistribute it and/or modify it
21 ;;; under the terms of the GNU General Public License as published by
22 ;;; the Free Software Foundation; either version 3 of the License, or (at
23 ;;; your option) any later version.
25 ;;; GNU Guix is distributed in the hope that it will be useful, but
26 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
27 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28 ;;; GNU General Public License for more details.
30 ;;; You should have received a copy of the GNU General Public License
31 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
33 (define-module (gnu packages machine-learning)
34 #:use-module ((guix licenses) #:prefix license:)
35 #:use-module (guix packages)
36 #:use-module (guix utils)
37 #:use-module (guix download)
38 #:use-module (guix svn-download)
39 #:use-module (guix build-system asdf)
40 #:use-module (guix build-system cmake)
41 #:use-module (guix build-system gnu)
42 #:use-module (guix build-system ocaml)
43 #:use-module (guix build-system python)
44 #:use-module (guix build-system r)
45 #:use-module (guix git-download)
46 #:use-module (gnu packages)
47 #:use-module (gnu packages adns)
48 #:use-module (gnu packages algebra)
49 #:use-module (gnu packages audio)
50 #:use-module (gnu packages autotools)
51 #:use-module (gnu packages base)
52 #:use-module (gnu packages bash)
53 #:use-module (gnu packages boost)
54 #:use-module (gnu packages check)
55 #:use-module (gnu packages compression)
56 #:use-module (gnu packages cran)
57 #:use-module (gnu packages databases)
58 #:use-module (gnu packages dejagnu)
59 #:use-module (gnu packages gcc)
60 #:use-module (gnu packages glib)
61 #:use-module (gnu packages graphviz)
62 #:use-module (gnu packages gstreamer)
63 #:use-module (gnu packages image)
64 #:use-module (gnu packages linux)
65 #:use-module (gnu packages lisp-xyz)
66 #:use-module (gnu packages maths)
67 #:use-module (gnu packages mpi)
68 #:use-module (gnu packages ocaml)
69 #:use-module (gnu packages onc-rpc)
70 #:use-module (gnu packages perl)
71 #:use-module (gnu packages pkg-config)
72 #:use-module (gnu packages protobuf)
73 #:use-module (gnu packages python)
74 #:use-module (gnu packages python-science)
75 #:use-module (gnu packages python-web)
76 #:use-module (gnu packages python-xyz)
77 #:use-module (gnu packages rpc)
78 #:use-module (gnu packages serialization)
79 #:use-module (gnu packages sphinx)
80 #:use-module (gnu packages statistics)
81 #:use-module (gnu packages sqlite)
82 #:use-module (gnu packages swig)
83 #:use-module (gnu packages web)
84 #:use-module (gnu packages xml)
85 #:use-module (gnu packages xorg)
86 #:use-module (ice-9 match))
89 ;; The last release is >100 commits behind, so we package from git.
90 (let ((commit "d71d54788bee56ba4cf7522801270152da5209d7"))
93 (version (string-append "2.2.0-1." (string-take commit 8)))
97 (url "https://github.com/libfann/fann.git")
99 (file-name (string-append name "-" version "-checkout"))
102 "0ibwpfrjs6q2lijs8slxjgzb2llcl6rk3v2ski4r6215g5jjhg3x"))))
103 (build-system cmake-build-system)
106 (modify-phases %standard-phases
108 (lambda* (#:key outputs #:allow-other-keys)
109 (let* ((out (assoc-ref outputs "out")))
110 (with-directory-excursion (string-append (getcwd) "/tests")
111 (invoke "./fann_tests"))))))))
112 (home-page "http://leenissen.dk/fann/wp/")
113 (synopsis "Fast Artificial Neural Network")
115 "FANN is a neural network library, which implements multilayer
116 artificial neural networks in C with support for both fully connected and
117 sparsely connected networks.")
118 (license license:lgpl2.1))))
120 (define-public libsvm
127 (uri (string-append "https://www.csie.ntu.edu.tw/~cjlin/libsvm/"
128 name "-" version ".tar.gz"))
130 (base32 "0jpaq0rr92x38p4nk3gjan79ip67m6p80anb28z1d8601miysyi5"))))
131 (build-system gnu-build-system)
133 `(#:tests? #f ; no "check" target
134 #:phases (modify-phases %standard-phases
137 'install ; no ‘install’ target
138 (lambda* (#:key outputs #:allow-other-keys)
139 (let* ((out (assoc-ref outputs "out"))
140 (bin (string-append out "/bin/")))
142 (for-each (lambda (file)
143 (copy-file file (string-append bin file)))
148 (home-page "https://www.csie.ntu.edu.tw/~cjlin/libsvm/")
149 (synopsis "Library for Support Vector Machines")
151 "LIBSVM is a machine learning library for support vector
152 classification, (C-SVC, nu-SVC), regression (epsilon-SVR, nu-SVR) and
153 distribution estimation (one-class SVM). It supports multi-class
155 (license license:bsd-3)))
157 (define-public python-libsvm
158 (package (inherit libsvm)
159 (name "python-libsvm")
160 (build-system gnu-build-system)
162 `(#:tests? #f ; no "check" target
163 #:make-flags '("-C" "python")
165 (modify-phases %standard-phases
168 'install ; no ‘install’ target
169 (lambda* (#:key inputs outputs #:allow-other-keys)
170 (let ((site (string-append (assoc-ref outputs "out")
174 (assoc-ref inputs "python") 5) 3)
176 (substitute* "python/svm.py"
177 (("../libsvm.so.2") "libsvm.so.2"))
179 (for-each (lambda (file)
180 (copy-file file (string-append site (basename file))))
181 (find-files "python" "\\.py"))
182 (copy-file "libsvm.so.2"
183 (string-append site "libsvm.so.2")))
186 `(("python" ,python)))
187 (synopsis "Python bindings of libSVM")))
190 ;; The latest release candidate is several years and a couple of fixes have
191 ;; been published since. This is why we download the sources from the SVN
193 (let ((svn-revision 2341))
196 (version (string-append "0.9-rc3-0." (number->string svn-revision)))
200 (url "http://svn.code.sf.net/p/ghmm/code/trunk")
201 (revision svn-revision)))
202 (file-name (string-append name "-" version "-checkout"))
205 "0qbq1rqp94l530f043qzp8aw5lj7dng9wq0miffd7spd1ff638wq"))))
206 (build-system gnu-build-system)
208 `(#:imported-modules (,@%gnu-build-system-modules
209 (guix build python-build-system))
210 #:modules ((guix build python-build-system)
211 ,@%gnu-build-system-modules)
213 (modify-phases %standard-phases
214 (add-after 'unpack 'enter-dir
215 (lambda _ (chdir "ghmm") #t))
217 (add-after 'install 'check
218 (assoc-ref %standard-phases 'check))
219 (add-before 'check 'fix-PYTHONPATH
220 (lambda* (#:key inputs outputs #:allow-other-keys)
221 (let ((python-version (python-version
222 (assoc-ref inputs "python"))))
224 (string-append (getenv "PYTHONPATH")
225 ":" (assoc-ref outputs "out")
226 "/lib/python" python-version
229 (add-after 'enter-dir 'fix-runpath
230 (lambda* (#:key outputs #:allow-other-keys)
231 (substitute* "ghmmwrapper/setup.py"
232 (("^(.*)extra_compile_args = \\[" line indent)
233 (string-append indent
234 "extra_link_args = [\"-Wl,-rpath="
235 (assoc-ref outputs "out") "/lib\"],\n"
238 (assoc-ref outputs "out")
241 (add-after 'enter-dir 'disable-broken-tests
243 (substitute* "tests/Makefile.am"
244 ;; GHMM_SILENT_TESTS is assumed to be a command.
245 (("TESTS_ENVIRONMENT.*") "")
246 ;; Do not build broken tests.
250 (("label_higher_order_test.*$")
251 "label_higher_order_test\n"))
253 ;; These Python unittests are broken as there is no gato.
254 ;; See https://sourceforge.net/p/ghmm/support-requests/3/
255 (substitute* "ghmmwrapper/ghmmunittests.py"
256 (("^(.*)def (testNewXML|testMultipleTransitionClasses|testNewXML)"
258 (string-append indent
259 "@unittest.skip(\"Disabled by Guix\")\n"
263 `(("python" ,python-2) ; only Python 2 is supported
264 ("libxml2" ,libxml2)))
266 `(("pkg-config" ,pkg-config)
269 ("autoconf" ,autoconf)
270 ("automake" ,automake)
271 ("libtool" ,libtool)))
272 (home-page "http://ghmm.org")
273 (synopsis "Hidden Markov Model library")
275 "The General Hidden Markov Model library (GHMM) is a C library with
276 additional Python bindings implementing a wide range of types of @dfn{Hidden
277 Markov Models} (HMM) and algorithms: discrete, continuous emissions, basic
278 training, HMM clustering, HMM mixtures.")
279 (license license:lgpl2.0+))))
288 "http://micans.org/mcl/src/mcl-"
289 (string-replace-substring version "." "-")
293 "15xlax3z31lsn62vlg94hkm75nm40q4679amnfg13jm8m2bnhy5m"))))
294 (build-system gnu-build-system)
296 `(#:configure-flags (list "--enable-blast")))
299 (home-page "http://micans.org/mcl/")
300 (synopsis "Clustering algorithm for graphs")
302 "The MCL algorithm is short for the @dfn{Markov Cluster Algorithm}, a
303 fast and scalable unsupervised cluster algorithm for graphs (also known as
304 networks) based on simulation of (stochastic) flow in graphs.")
305 ;; In the LICENCE file and web page it says "The software is licensed
306 ;; under the GNU General Public License, version 3.", but in several of
307 ;; the source code files it suggests GPL3 or later.
308 ;; http://listserver.ebi.ac.uk/pipermail/mcl-users/2016/000376.html
309 (license license:gpl3)))
311 (define-public ocaml-mcl
314 (version "12-068oasis4")
319 (url "https://github.com/fhcrc/mcl.git")
321 (file-name (git-file-name name version))
324 "0009dc3h2jp3qg5val452wngpqnbfyhbcxylghq0mrjqxx0jdq5p"))))
325 (build-system ocaml-build-system)
328 (modify-phases %standard-phases
329 (add-before 'configure 'patch-paths
331 (substitute* "configure"
332 (("/bin/sh") (which "sh")))
333 (substitute* "setup.ml"
335 (string-append "LDFLAGS=-fPIC\"; \"SHELL=" (which "sh")))
336 (("-std=c89") "-std=gnu99")
338 ;; This is a mutable string, which is no longer supported. Use
339 ;; a byte buffer instead.
340 (("String.make \\(String.length s\\)")
341 "Bytes.make (String.length s)")
343 ;; These two belong together.
344 (("OASISString.replace_chars")
345 "Bytes.to_string (OASISString.replace_chars")
348 (substitute* "myocamlbuild.ml"
349 (("std=c89") "std=gnu99"))
350 ;; Since we build with a more recent OCaml, we have to use C99 or
351 ;; later. This causes problems with the old C code.
352 (substitute* "src/impala/matrix.c"
353 (("restrict") "restrict_"))
356 `(("ocamlbuild" ,ocamlbuild)))
357 (home-page "https://github.com/fhcrc/mcl")
358 (synopsis "OCaml wrappers around MCL")
360 "This package provides OCaml bindings for the MCL graph clustering
362 (license license:gpl3)))
364 (define-public randomjungle
366 (name "randomjungle")
372 "https://www.imbs.uni-luebeck.de/fileadmin/files/Software"
373 "/randomjungle/randomjungle-" version ".tar_.gz"))
374 (patches (search-patches "randomjungle-disable-static-build.patch"))
377 "12c8rf30cla71swx2mf4ww9mfd8jbdw5lnxd7dxhyw1ygrvg6y4w"))))
378 (build-system gnu-build-system)
381 (list "--disable-static"
382 (string-append "--with-boost="
383 (assoc-ref %build-inputs "boost")))
385 (modify-phases %standard-phases
387 'configure 'set-CXXFLAGS
389 (setenv "CXXFLAGS" "-fpermissive ")
397 `(("gfortran" ,gfortran)
398 ("gfortran:lib" ,gfortran "lib")))
399 ;; Non-portable assembly instructions are used so building fails on
400 ;; platforms other than x86_64 or i686.
401 (supported-systems '("x86_64-linux" "i686-linux"))
402 (home-page "https://www.imbs.uni-luebeck.de/forschung/software/details.html#c224")
403 (synopsis "Implementation of the Random Forests machine learning method")
405 "Random Jungle is an implementation of Random Forests. It is supposed to
406 analyse high dimensional data. In genetics, it can be used for analysing big
407 Genome Wide Association (GWA) data. Random Forests is a powerful machine
408 learning method. Most interesting features are variable selection, missing
409 value imputation, classifier creation, generalization error estimation and
410 sample proximities between pairs of cases.")
411 (license license:gpl3+)))
413 (define-public openfst
419 (uri (string-append "http://www.openfst.org/twiki/pub/FST/"
420 "FstDownload/openfst-" version ".tar.gz"))
423 "0fqgk8195kz21is09gwzwnrg7fr9526bi9mh4apyskapz27pbhr1"))))
424 (build-system gnu-build-system)
425 (home-page "http://www.openfst.org")
426 (synopsis "Library for weighted finite-state transducers")
427 (description "OpenFst is a library for constructing, combining,
428 optimizing, and searching weighted finite-state transducers (FSTs).")
429 (license license:asl2.0)))
431 (define-public shogun
439 "ftp://shogun-toolbox.org/shogun/releases/"
440 (version-major+minor version)
441 "/sources/shogun-" version ".tar.bz2"))
444 "1rn9skm3nw6hr7mr3lgp2gfqhi7ii0lyxck7qmqnf8avq349s5jp"))
445 (modules '((guix build utils)
449 ;; Remove non-free sources and files referencing them
450 (for-each delete-file
451 (find-files "src/shogun/classifier/svm/"
452 "SVMLight\\.(cpp|h)"))
453 (for-each delete-file
454 (find-files "examples/undocumented/libshogun/"
456 "(classifier_.*svmlight.*|"
457 "evaluation_cross_validation_locked_comparison).cpp")))
458 ;; Remove non-free functions.
459 (define (delete-ifdefs file)
460 (with-atomic-file-replacement file
462 (let loop ((line (read-line in 'concat))
464 (if (eof-object? line)
469 "#endif //USE_SVMLIGHT" line)))
471 "#ifdef USE_SVMLIGHT" line))))
472 (when (or (not skipping?)
473 (and skipping? (not skip-next?)))
475 (loop (read-line in 'concat) skip-next?)))))))
476 (for-each delete-ifdefs
478 (find-files "src/shogun/classifier/mkl"
479 "^MKLClassification\\.cpp")
480 (find-files "src/shogun/classifier/svm"
481 "^SVMLightOneClass\\.(cpp|h)")
482 (find-files "src/shogun/multiclass"
483 "^ScatterSVM\\.(cpp|h)")
484 (find-files "src/shogun/kernel/"
485 "^(Kernel|CombinedKernel|ProductKernel)\\.(cpp|h)")
486 (find-files "src/shogun/regression/svr"
487 "^(MKLRegression|SVRLight)\\.(cpp|h)")
488 (find-files "src/shogun/transfer/domain_adaptation"
489 "^DomainAdaptationSVM\\.(cpp|h)")))
491 (build-system cmake-build-system)
493 '(#:tests? #f ;no check target
495 (modify-phases %standard-phases
496 (add-after 'unpack 'delete-broken-symlinks
498 (for-each delete-file '("applications/arts/data"
499 "applications/asp/data"
500 "applications/easysvm/data"
501 "applications/msplicer/data"
502 "applications/ocr/data"
504 "examples/undocumented/data"))
506 (add-after 'unpack 'change-R-target-path
507 (lambda* (#:key outputs #:allow-other-keys)
508 (substitute* '("src/interfaces/r/CMakeLists.txt"
509 "examples/meta/r/CMakeLists.txt")
510 (("\\$\\{R_COMPONENT_LIB_PATH\\}")
511 (string-append (assoc-ref outputs "out")
514 (add-after 'unpack 'fix-octave-modules
515 (lambda* (#:key outputs #:allow-other-keys)
516 (substitute* "src/interfaces/octave/CMakeLists.txt"
517 (("^include_directories\\(\\$\\{OCTAVE_INCLUDE_DIRS\\}")
518 "include_directories(${OCTAVE_INCLUDE_DIRS} ${OCTAVE_INCLUDE_DIRS}/octave")
519 ;; change target directory
520 (("\\$\\{OCTAVE_OCT_LOCAL_API_FILE_DIR\\}")
521 (string-append (assoc-ref outputs "out")
522 "/share/octave/packages")))
523 (substitute* '("src/interfaces/octave/swig_typemaps.i"
524 "src/interfaces/octave/sg_print_functions.cpp")
525 ;; "octave/config.h" and "octave/oct-obj.h" deprecated in Octave.
526 (("octave/config\\.h") "octave/octave-config.h")
527 (("octave/oct-obj.h") "octave/ovl.h"))
529 (add-after 'unpack 'move-rxcpp
530 (lambda* (#:key inputs #:allow-other-keys)
531 (let ((rxcpp-dir "shogun/third-party/rxcpp"))
533 (install-file (assoc-ref inputs "rxcpp") rxcpp-dir)
535 (add-before 'build 'set-HOME
536 ;; $HOME needs to be set at some point during the build phase
537 (lambda _ (setenv "HOME" "/tmp") #t)))
539 (list "-DCMAKE_BUILD_WITH_INSTALL_RPATH=TRUE"
540 "-DUSE_SVMLIGHT=OFF" ;disable proprietary SVMLIGHT
541 "-DBUILD_META_EXAMPLES=OFF" ;requires unpackaged ctags
542 ;;"-DINTERFACE_JAVA=ON" ;requires unpackaged jblas
543 ;;"-DINTERFACE_RUBY=ON" ;requires unpackaged ruby-narray
544 ;;"-DINTERFACE_PERL=ON" ;"FindPerlLibs" does not exist
545 ;;"-DINTERFACE_LUA=ON" ;fails because lua doesn't build pkgconfig file
546 "-DINTERFACE_OCTAVE=ON"
547 "-DINTERFACE_PYTHON=ON"
548 "-DINTERFACE_R=ON")))
551 ("numpy" ,python-numpy)
552 ("r-minimal" ,r-minimal)
553 ("octave" ,octave-cli)
558 ("arpack" ,arpack-ng)
565 `(("pkg-config" ,pkg-config)
567 ;; Non-portable SSE instructions are used so building fails on platforms
568 ;; other than x86_64.
569 (supported-systems '("x86_64-linux"))
570 (home-page "https://shogun-toolbox.org/")
571 (synopsis "Machine learning toolbox")
573 "The Shogun Machine learning toolbox provides a wide range of unified and
574 efficient Machine Learning (ML) methods. The toolbox seamlessly
575 combines multiple data representations, algorithm classes, and general purpose
576 tools. This enables both rapid prototyping of data pipelines and extensibility
577 in terms of new algorithms.")
578 (license license:gpl3+)))
588 (url "https://github.com/ReactiveX/RxCpp.git")
589 (commit (string-append "v" version))))
591 (base32 "1rdpa3jlc181jd08nk437aar085h28i45s6nzrv65apb3xyyz0ij"))
592 (file-name (git-file-name name version))))
593 (build-system cmake-build-system)
596 (modify-phases %standard-phases
597 (add-after 'unpack 'remove-werror
599 (substitute* (find-files ".")
604 (invoke "ctest"))))))
606 `(("catch" ,catch-framework)))
607 (home-page "http://reactivex.io/")
608 (synopsis "Reactive Extensions for C++")
610 "The Reactive Extensions for C++ (RxCpp) is a library of algorithms for
611 values-distributed-in-time. ReactiveX is a library for composing asynchronous
612 and event-based programs by using observable sequences.
614 It extends the observer pattern to support sequences of data and/or events and
615 adds operators that allow you to compose sequences together declaratively while
616 abstracting away concerns about things like low-level threading,
617 synchronization, thread-safety, concurrent data structures, and non-blocking
619 (license license:asl2.0)))
621 (define-public r-adaptivesparsity
623 (name "r-adaptivesparsity")
627 (uri (cran-uri "AdaptiveSparsity" version))
630 "0imr5m8mll9j6n4icsv6z9rl5kbnwsp9wvzrg7n90nnmcxq2cz91"))))
632 `((upstream-name . "AdaptiveSparsity")))
633 (build-system r-build-system)
636 (modify-phases %standard-phases
637 (add-after 'unpack 'link-against-armadillo
639 (substitute* "src/Makevars"
640 (("PKG_LIBS=" prefix)
641 (string-append prefix "-larmadillo"))))))))
644 ("r-matrix" ,r-matrix)
646 ("r-rcpparmadillo" ,r-rcpparmadillo)))
648 `(("armadillo" ,armadillo)))
649 (home-page "https://cran.r-project.org/web/packages/AdaptiveSparsity")
650 (synopsis "Adaptive sparsity models")
652 "This package implements the Figueiredo machine learning algorithm for
653 adaptive sparsity and the Wong algorithm for adaptively sparse gaussian
655 (license license:lgpl3+)))
657 (define-public gemmlowp-for-tensorflow
658 ;; The commit hash is taken from "tensorflow/workspace.bzl".
659 (let ((commit "38ebac7b059e84692f53e5938f97a9943c120d98")
663 (version (git-version "0" revision commit))
666 (uri (string-append "https://mirror.bazel.build/"
667 "github.com/google/gemmlowp/archive/"
669 (file-name (string-append "gemmlowp-" version ".zip"))
672 "0n56s2g8hrssm4w8qj1v58gfm56a04n9v992ixkmvk6zjiralzxq"))))
673 (build-system cmake-build-system)
676 (list ,@(match (%current-system)
677 ((or "x86_64-linux" "i686-linux")
678 '("-DCMAKE_CXX_FLAGS=-msse2"))
681 (modify-phases %standard-phases
682 ;; This directory contains the CMakeLists.txt.
683 (add-after 'unpack 'chdir
684 (lambda _ (chdir "contrib") #t))
685 ;; There is no install target
687 (lambda* (#:key outputs #:allow-other-keys)
688 (let* ((out (assoc-ref outputs "out"))
689 (lib (string-append out "/lib/"))
690 (inc (string-append out "/include/")))
691 (install-file "../build/libeight_bit_int_gemm.so" lib)
692 (for-each (lambda (dir)
693 (let ((target (string-append inc "/" dir)))
695 (for-each (lambda (h)
696 (install-file h target))
697 (find-files (string-append "../" dir)
699 '("meta" "profiling" "public" "fixedpoint"
700 "eight_bit_int_gemm" "internal"))
704 (home-page "https://github.com/google/gemmlowp")
705 (synopsis "Small self-contained low-precision GEMM library")
707 "This is a small self-contained low-precision @dfn{general matrix
708 multiplication} (GEMM) library. It is not a full linear algebra library.
709 Low-precision means that the input and output matrix entries are integers on
710 at most 8 bits. To avoid overflow, results are internally accumulated on more
711 than 8 bits, and at the end only some significant 8 bits are kept.")
712 (license license:asl2.0))))
721 "http://dlib.net/files/dlib-" version ".tar.bz2"))
724 "1mljz02kwkrbggyncxv5fpnyjdybw2qihaacb3js8yfkw12vwpc2"))
725 (modules '((guix build utils)))
728 ;; Delete ~13MB of bundled dependencies.
729 (delete-file-recursively "dlib/external")
730 (delete-file-recursively "docs/dlib/external")
732 (build-system cmake-build-system)
735 (modify-phases %standard-phases
736 (add-after 'unpack 'disable-asserts
738 ;; config.h recommends explicitly enabling or disabling asserts
739 ;; when building as a shared library. By default neither is set.
740 (substitute* "dlib/config.h"
741 (("^//#define DLIB_DISABLE_ASSERTS") "#define DLIB_DISABLE_ASSERTS"))
743 (add-after 'disable-asserts 'disable-failing-tests
745 ;; One test times out on MIPS, so we need to disable it.
746 ;; Others are flaky on some platforms.
747 (let* ((system ,(or (%current-target-system)
749 (disabled-tests (cond
750 ((string-prefix? "mips64" system)
751 '("object_detector" ; timeout
753 ((string-prefix? "armhf" system)
754 '("learning_to_track"))
755 ((string-prefix? "i686" system)
760 (substitute* "dlib/test/makefile"
761 (((string-append "SRC \\+= " test "\\.cpp")) "")))
766 ;; No test target, so we build and run the unit tests here.
767 (let ((test-dir (string-append "../dlib-" ,version "/dlib/test")))
768 (with-directory-excursion test-dir
769 (invoke "make" "-j" (number->string (parallel-job-count)))
770 (invoke "./dtest" "--runall"))
772 (add-after 'install 'delete-static-library
773 (lambda* (#:key outputs #:allow-other-keys)
774 (delete-file (string-append (assoc-ref outputs "out")
778 `(("pkg-config" ,pkg-config)
784 ("libjpeg" ,libjpeg-turbo)
787 ("openblas" ,openblas)
790 "Toolkit for making machine learning and data analysis applications in C++")
792 "Dlib is a modern C++ toolkit containing machine learning algorithms and
793 tools. It is used in both industry and academia in a wide range of domains
794 including robotics, embedded devices, mobile phones, and large high performance
795 computing environments.")
796 (home-page "http://dlib.net")
797 (license license:boost1.0)))
799 (define-public python-scikit-learn
801 (name "python-scikit-learn")
807 (url "https://github.com/scikit-learn/scikit-learn.git")
809 (file-name (git-file-name name version))
812 "1xqxv210gsmjw094vc5ghq2y9lmm74qkk22pq6flcjzj51b86jxf"))))
813 (build-system python-build-system)
816 (modify-phases %standard-phases
817 (add-after 'build 'build-ext
818 (lambda _ (invoke "python" "setup.py" "build_ext" "--inplace") #t))
821 ;; Restrict OpenBLAS threads to prevent segfaults while testing!
822 (setenv "OPENBLAS_NUM_THREADS" "1")
824 ;; Some tests require write access to $HOME.
825 (setenv "HOME" "/tmp")
827 (invoke "pytest" "sklearn" "-m" "not network")))
828 (add-before 'reset-gzip-timestamps 'make-files-writable
829 (lambda* (#:key outputs #:allow-other-keys)
830 ;; Make sure .gz files are writable so that the
831 ;; 'reset-gzip-timestamps' phase can do its work.
832 (let ((out (assoc-ref outputs "out")))
833 (for-each make-file-writable
834 (find-files out "\\.gz$"))
837 `(("openblas" ,openblas)))
839 `(("python-pytest" ,python-pytest)
840 ("python-pandas" ,python-pandas) ;for tests
841 ("python-cython" ,python-cython)))
843 `(("python-numpy" ,python-numpy)
844 ("python-scipy" ,python-scipy)
845 ("python-joblib" ,python-joblib)))
846 (home-page "https://scikit-learn.org/")
847 (synopsis "Machine Learning in Python")
849 "Scikit-learn provides simple and efficient tools for data mining and
851 (properties `((python2-variant . ,(delay python2-scikit-learn))))
852 (license license:bsd-3)))
854 ;; scikit-learn 0.22 and later only supports Python 3, so we stick with
855 ;; an older version here.
856 (define-public python2-scikit-learn
857 (let ((base (package-with-python2 (strip-python2-variant python-scikit-learn))))
864 (url "https://github.com/scikit-learn/scikit-learn.git")
866 (file-name (git-file-name "python-scikit-learn" version))
869 "08zbzi8yx5wdlxfx9jap61vg1malc9ajf576w7a0liv6jvvrxlpj")))))))
871 (define-public python-scikit-rebate
873 (name "python-scikit-rebate")
877 (uri (pypi-uri "skrebate" version))
880 "1h7qs9gjxpzqabzhb8rmpv3jpmi5iq41kqdibg48299h94iikiw7"))))
881 (build-system python-build-system)
882 ;; Pandas is only needed to run the tests.
884 `(("python-pandas" ,python-pandas)))
886 `(("python-numpy" ,python-numpy)
887 ("python-scipy" ,python-scipy)
888 ("python-scikit-learn" ,python-scikit-learn)
889 ("python-joblib" ,python-joblib)))
890 (home-page "https://epistasislab.github.io/scikit-rebate/")
891 (synopsis "Relief-based feature selection algorithms for Python")
892 (description "Scikit-rebate is a scikit-learn-compatible Python
893 implementation of ReBATE, a suite of Relief-based feature selection algorithms
894 for Machine Learning. These algorithms excel at identifying features that are
895 predictive of the outcome in supervised learning problems, and are especially
896 good at identifying feature interactions that are normally overlooked by
897 standard feature selection algorithms.")
898 (license license:expat)))
900 (define-public python-autograd
901 (let* ((commit "442205dfefe407beffb33550846434baa90c4de7")
903 (version (git-version "0.0.0" revision commit)))
905 (name "python-autograd")
906 (home-page "https://github.com/HIPS/autograd")
914 "189sv2xb0mwnjawa9z7mrgdglc1miaq93pnck26r28fi1jdwg0z4"))
915 (file-name (git-file-name name version))))
917 (build-system python-build-system)
919 `(("python-nose" ,python-nose)
920 ("python-pytest" ,python-pytest)))
922 `(("python-future" ,python-future)
923 ("python-numpy" ,python-numpy)))
925 `(#:phases (modify-phases %standard-phases
928 (invoke "py.test" "-v"))))))
929 (synopsis "Efficiently computes derivatives of NumPy code")
930 (description "Autograd can automatically differentiate native Python and
931 NumPy code. It can handle a large subset of Python's features, including loops,
932 ifs, recursion and closures, and it can even take derivatives of derivatives
933 of derivatives. It supports reverse-mode differentiation
934 (a.k.a. backpropagation), which means it can efficiently take gradients of
935 scalar-valued functions with respect to array-valued arguments, as well as
936 forward-mode differentiation, and the two can be composed arbitrarily. The
937 main intended application of Autograd is gradient-based optimization.")
938 (license license:expat))))
940 (define-public python2-autograd
941 (package-with-python2 python-autograd))
943 (define-public lightgbm
950 "https://github.com/Microsoft/LightGBM/archive/v"
954 "132zf0yk0545mg72hyzxm102g3hpb6ixx9hnf8zd2k55gas6cjj1"))
955 (file-name (string-append name "-" version ".tar.gz"))))
957 `(("python-pytest" ,python-pytest)
958 ("python-nose" ,python-nose)))
960 `(("openmpi" ,openmpi)))
962 `(("python-numpy" ,python-numpy)
963 ("python-scipy" ,python-scipy)))
968 (modify-phases %standard-phases
970 (lambda* (#:key outputs #:allow-other-keys)
971 (with-directory-excursion ,(string-append "../LightGBM-" version)
972 (invoke "pytest" "tests/c_api_test/test_.py")))))))
973 (build-system cmake-build-system)
974 (home-page "https://github.com/Microsoft/LightGBM")
975 (synopsis "Gradient boosting framework based on decision tree algorithms")
976 (description "LightGBM is a gradient boosting framework that uses tree
977 based learning algorithms. It is designed to be distributed and efficient with
978 the following advantages:
981 @item Faster training speed and higher efficiency
982 @item Lower memory usage
983 @item Better accuracy
984 @item Parallel and GPU learning supported (not enabled in this package)
985 @item Capable of handling large-scale data
987 (license license:expat)))
989 (define-public vowpal-wabbit
990 ;; Language bindings not included.
992 (name "vowpal-wabbit")
997 (url "https://github.com/JohnLangford/vowpal_wabbit")
1001 "04bwzk6ifgnz3fmzid8b7avxf9n5pnx9xcjm61nkjng1vv0bpj8x"))
1002 (file-name (git-file-name name version))))
1008 (list (string-append "--with-boost="
1009 (assoc-ref %build-inputs "boost")))
1011 (modify-phases %standard-phases
1012 (add-after 'unpack 'make-files-writable
1014 (for-each make-file-writable (find-files "." ".*")) #t)))))
1015 (build-system gnu-build-system)
1016 (home-page "https://github.com/JohnLangford/vowpal_wabbit")
1017 (synopsis "Fast machine learning library for online learning")
1018 (description "Vowpal Wabbit is a machine learning system with techniques
1019 such as online, hashing, allreduce, reductions, learning2search, active, and
1020 interactive learning.")
1021 (license license:bsd-3)))
1023 (define-public python2-fastlmm
1025 (name "python2-fastlmm")
1030 (uri (pypi-uri "fastlmm" version ".zip"))
1033 "1q8c34rpmwkfy3r4d5172pzdkpfryj561897z9r3x22gq7813x1m"))))
1034 (build-system python-build-system)
1036 `(#:tests? #f ; some test files are missing
1037 #:python ,python-2)) ; only Python 2.7 is supported
1039 `(("python2-numpy" ,python2-numpy)
1040 ("python2-scipy" ,python2-scipy)
1041 ("python2-matplotlib" ,python2-matplotlib)
1042 ("python2-pandas" ,python2-pandas)
1043 ("python2-scikit-learn" ,python2-scikit-learn)
1044 ("python2-pysnptools" ,python2-pysnptools)))
1047 ("python2-cython" ,python2-cython)
1048 ("python2-mock" ,python2-mock)
1049 ("python2-nose" ,python2-nose)))
1050 (home-page "http://research.microsoft.com/en-us/um/redmond/projects/mscompbio/fastlmm/")
1051 (synopsis "Perform genome-wide association studies on large data sets")
1053 "FaST-LMM, which stands for Factored Spectrally Transformed Linear Mixed
1054 Models, is a program for performing both single-SNP and SNP-set genome-wide
1055 association studies (GWAS) on extremely large data sets.")
1056 (license license:asl2.0)))
1058 ;; There have been no proper releases yet.
1059 (define-public kaldi
1060 (let ((commit "d4791c0f3fc1a09c042dac365e120899ee2ad21e")
1064 (version (git-version "0" revision commit))
1068 (url "https://github.com/kaldi-asr/kaldi.git")
1070 (file-name (git-file-name name version))
1073 "07k80my6f19mhrkwbzhjsnpf9871wmrwkl0ym468i830w67qyjrz"))))
1074 (build-system gnu-build-system)
1076 `(#:test-target "test"
1078 (modify-phases %standard-phases
1079 (add-after 'unpack 'chdir
1080 (lambda _ (chdir "src") #t))
1082 (lambda* (#:key build system inputs outputs #:allow-other-keys)
1083 (when (not (or (string-prefix? "x86_64" system)
1084 (string-prefix? "i686" system)))
1085 (substitute* "makefiles/linux_openblas.mk"
1086 (("-msse -msse2") "")))
1087 (substitute* "makefiles/default_rules.mk"
1088 (("/bin/bash") (which "bash")))
1089 (substitute* "Makefile"
1090 (("ext_depend: check_portaudio")
1092 (substitute* '("online/Makefile"
1093 "onlinebin/Makefile"
1094 "gst-plugin/Makefile")
1095 (("../../tools/portaudio/install")
1096 (assoc-ref inputs "portaudio")))
1098 ;; This `configure' script doesn't support variables passed as
1099 ;; arguments, nor does it support "prefix".
1100 (let ((out (assoc-ref outputs "out"))
1101 (openblas (assoc-ref inputs "openblas"))
1102 (openfst (assoc-ref inputs "openfst")))
1103 (substitute* "configure"
1104 (("check_for_slow_expf;") "")
1105 ;; This affects the RPATH and also serves as the installation
1107 (("KALDILIBDIR=`pwd`/lib")
1108 (string-append "KALDILIBDIR=" out "/lib")))
1109 (mkdir-p out) ; must exist
1110 (setenv "CONFIG_SHELL" (which "bash"))
1111 (setenv "OPENFST_VER" ,(package-version openfst))
1112 (invoke "./configure"
1115 (string-append "--openblas-root=" openblas)
1116 (string-append "--fst-root=" openfst)))))
1117 (add-after 'build 'build-ext-and-gstreamer-plugin
1119 (invoke "make" "-C" "online" "depend")
1120 (invoke "make" "-C" "online")
1121 (invoke "make" "-C" "onlinebin" "depend")
1122 (invoke "make" "-C" "onlinebin")
1123 (invoke "make" "-C" "gst-plugin" "depend")
1124 (invoke "make" "-C" "gst-plugin")
1126 ;; TODO: also install the executables.
1128 (lambda* (#:key outputs #:allow-other-keys)
1129 (let* ((out (assoc-ref outputs "out"))
1130 (inc (string-append out "/include"))
1131 (lib (string-append out "/lib")))
1133 ;; The build phase installed symlinks to the actual
1134 ;; libraries. Install the actual targets.
1135 (for-each (lambda (file)
1136 (let ((target (readlink file)))
1138 (install-file target lib)))
1139 (find-files lib "\\.so"))
1141 (for-each (lambda (file)
1142 (let ((target-dir (string-append inc "/" (dirname file))))
1143 (install-file file target-dir)))
1144 (find-files "." "\\.h"))
1145 (install-file "gst-plugin/libgstonlinegmmdecodefaster.so"
1146 (string-append lib "/gstreamer-1.0"))
1149 `(("alsa-lib" ,alsa-lib)
1150 ("gfortran" ,gfortran "lib")
1152 ("gstreamer" ,gstreamer)
1154 ("openblas" ,openblas)
1155 ("openfst" ,openfst)
1156 ("portaudio" ,portaudio)
1157 ("python" ,python)))
1159 `(("glib" ,glib "bin") ; glib-genmarshal
1162 ("pkg-config" ,pkg-config)
1164 (home-page "https://kaldi-asr.org/")
1165 (synopsis "Speech recognition toolkit")
1166 (description "Kaldi is an extensible toolkit for speech recognition
1168 (license license:asl2.0))))
1170 (define-public gst-kaldi-nnet2-online
1171 (let ((commit "cb227ef43b66a9835c14eb0ad39e08ee03c210ad")
1174 (name "gst-kaldi-nnet2-online")
1175 (version (git-version "0" revision commit))
1179 (url "https://github.com/alumae/gst-kaldi-nnet2-online.git")
1181 (file-name (git-file-name name version))
1184 "1i6ffwiavxx07ri0lxix6s8q0r31x7i4xxvhys5jxkixf5q34w8g"))))
1185 (build-system gnu-build-system)
1187 `(#:tests? #f ; there are none
1189 (list (string-append "SHELL="
1190 (assoc-ref %build-inputs "bash") "/bin/bash")
1191 (string-append "KALDI_ROOT="
1192 (assoc-ref %build-inputs "kaldi-src"))
1193 (string-append "KALDILIBDIR="
1194 (assoc-ref %build-inputs "kaldi") "/lib")
1195 "KALDI_FLAVOR=dynamic")
1197 (modify-phases %standard-phases
1198 (add-after 'unpack 'chdir
1199 (lambda _ (chdir "src") #t))
1201 (lambda* (#:key inputs #:allow-other-keys)
1202 (let ((glib (assoc-ref inputs "glib")))
1203 (setenv "CXXFLAGS" "-fPIC")
1204 (setenv "CPLUS_INCLUDE_PATH"
1205 (string-append glib "/include/glib-2.0:"
1206 glib "/lib/glib-2.0/include:"
1207 (assoc-ref inputs "gstreamer")
1208 "/include/gstreamer-1.0")))
1209 (substitute* "Makefile"
1210 (("include \\$\\(KALDI_ROOT\\)/src/kaldi.mk") "")
1211 (("\\$\\(error Cannot find") "#"))
1213 (add-before 'build 'build-depend
1214 (lambda* (#:key make-flags #:allow-other-keys)
1215 (apply invoke "make" "depend" make-flags)))
1217 (lambda* (#:key outputs #:allow-other-keys)
1218 (let* ((out (assoc-ref outputs "out"))
1219 (lib (string-append out "/lib/gstreamer-1.0")))
1220 (install-file "libgstkaldinnet2onlinedecoder.so" lib)
1224 ("gstreamer" ,gstreamer)
1225 ("jansson" ,jansson)
1226 ("openfst" ,openfst)
1230 ("glib:bin" ,glib "bin") ; glib-genmarshal
1231 ("kaldi-src" ,(package-source kaldi))
1232 ("pkg-config" ,pkg-config)))
1233 (home-page "https://kaldi-asr.org/")
1234 (synopsis "Gstreamer plugin for decoding speech")
1235 (description "This package provides a GStreamer plugin that wraps
1236 Kaldi's @code{SingleUtteranceNnet2Decoder}. It requires iVector-adapted DNN
1237 acoustic models. The iVectors are adapted to the current audio stream
1239 (license license:asl2.0))))
1241 (define-public kaldi-gstreamer-server
1242 ;; This is the tip of the py3 branch
1243 (let ((commit "f68cab490be7eb0da2af1475fbc16655f50a60cb")
1246 (name "kaldi-gstreamer-server")
1247 (version (git-version "0" revision commit))
1251 (url "https://github.com/alumae/kaldi-gstreamer-server.git")
1253 (file-name (git-file-name name version))
1256 "17lh1368vkg8ngrcbn2phvigzlmalrqg6djx2gg61qq1a0nj87dm"))))
1257 (build-system gnu-build-system)
1259 `(#:tests? #f ; there are no tests that can be run automatically
1260 #:modules ((guix build utils)
1261 (guix build gnu-build-system)
1264 (modify-phases %standard-phases
1267 (lambda* (#:key outputs #:allow-other-keys)
1268 ;; Disable hash randomization to ensure the generated .pycs
1269 ;; are reproducible.
1270 (setenv "PYTHONHASHSEED" "0")
1271 (with-directory-excursion "kaldigstserver"
1272 ;; See https://github.com/alumae/kaldi-gstreamer-server/issues/232
1273 (substitute* "master_server.py"
1274 (("\\.replace\\('\\\\.*") ")"))
1276 ;; This is a Python 2 file
1277 (delete-file "decoder_test.py")
1278 (delete-file "test-buffer.py")
1280 (for-each (lambda (file)
1284 "-f" ; force rebuild
1286 (find-files "." "\\.py$")))
1289 (lambda* (#:key inputs outputs #:allow-other-keys)
1290 (let* ((out (assoc-ref outputs "out"))
1291 (bin (string-append out "/bin"))
1292 (share (string-append out "/share/kaldi-gstreamer-server/")))
1293 ;; Install Python files
1294 (with-directory-excursion "kaldigstserver"
1295 (for-each (cut install-file <> share)
1296 (find-files "." ".*")))
1298 ;; Install sample configuration files
1299 (for-each (cut install-file <> share)
1300 (find-files "." "\\.yaml"))
1302 ;; Install executables
1304 (let* ((server (string-append bin "/kaldi-gst-server"))
1305 (client (string-append bin "/kaldi-gst-client"))
1306 (worker (string-append bin "/kaldi-gst-worker"))
1307 (PYTHONPATH (getenv "PYTHONPATH"))
1308 (GST_PLUGIN_PATH (string-append
1309 (assoc-ref inputs "gst-kaldi-nnet2-online")
1310 "/lib/gstreamer-1.0:${GST_PLUGIN_PATH}"))
1311 (wrap (lambda (wrapper what)
1312 (with-output-to-file wrapper
1316 export PYTHONPATH=~a
1317 export GST_PLUGIN_PATH=~a
1318 exec ~a ~a/~a \"$@\"~%"
1319 (which "bash") PYTHONPATH GST_PLUGIN_PATH
1320 (which "python") share what)))
1321 (chmod wrapper #o555))))
1323 (list server client worker)
1324 (list "master_server.py"
1329 `(("gst-kaldi-nnet2-online" ,gst-kaldi-nnet2-online)
1330 ("python" ,python-wrapper)
1331 ("python-pygobject" ,python-pygobject)
1332 ("python-pyyaml" ,python-pyyaml)
1333 ("python-tornado" ,python-tornado-6)))
1334 (home-page "https://github.com/alumae/kaldi-gstreamer-server")
1335 (synopsis "Real-time full-duplex speech recognition server")
1336 (description "This is a real-time full-duplex speech recognition server,
1337 based on the Kaldi toolkit and the GStreamer framework and implemented in
1339 (license license:bsd-2))))
1341 ;; Note that Tensorflow includes a "third_party" directory, which seems to not
1342 ;; only contain modified subsets of upstream library source code, but also
1343 ;; adapter headers provided by Google (such as the fft.h header, which is not
1344 ;; part of the upstream project code). The Tensorflow code includes headers
1345 ;; from the "third_party" directory. It does not look like we can replace
1346 ;; these headers with unmodified upstream files, so we keep them.
1347 (define-public tensorflow
1355 (url "https://github.com/tensorflow/tensorflow.git")
1356 (commit (string-append "v" version))))
1357 (file-name (string-append "tensorflow-" version "-checkout"))
1360 "0a9kwha395g3wgxfwln5j8vn9nkspmd75xldrlqdq540w996g8xa"))))
1361 (build-system cmake-build-system)
1363 `(#:tests? #f ; no "check" target
1364 #:build-type "Release"
1366 (let ((protobuf (assoc-ref %build-inputs "protobuf"))
1367 (protobuf:native (assoc-ref %build-inputs "protobuf:native"))
1368 (jsoncpp (assoc-ref %build-inputs "jsoncpp"))
1369 (snappy (assoc-ref %build-inputs "snappy"))
1370 (sqlite (assoc-ref %build-inputs "sqlite")))
1372 ;; Use protobuf from Guix
1373 (string-append "-Dprotobuf_STATIC_LIBRARIES="
1374 protobuf "/lib/libprotobuf.so")
1375 (string-append "-DPROTOBUF_PROTOC_EXECUTABLE="
1376 protobuf:native "/bin/protoc")
1378 ;; Use snappy from Guix
1379 (string-append "-Dsnappy_STATIC_LIBRARIES="
1380 snappy "/lib/libsnappy.so")
1381 ;; Yes, this is not actually the include directory but a prefix...
1382 (string-append "-Dsnappy_INCLUDE_DIR=" snappy)
1384 ;; Use jsoncpp from Guix
1385 (string-append "-Djsoncpp_STATIC_LIBRARIES="
1386 jsoncpp "/lib/libjsoncpp.so")
1387 ;; Yes, this is not actually the include directory but a prefix...
1388 (string-append "-Djsoncpp_INCLUDE_DIR=" jsoncpp)
1390 ;; Use sqlite from Guix
1391 (string-append "-Dsqlite_STATIC_LIBRARIES="
1392 sqlite "/lib/libsqlite.a")
1394 ;; Use system libraries wherever possible. Currently, this
1395 ;; only affects zlib.
1396 "-Dsystemlib_ALL=ON"
1397 "-Dtensorflow_ENABLE_POSITION_INDEPENDENT_CODE=ON"
1398 "-Dtensorflow_BUILD_SHARED_LIB=ON"
1399 "-Dtensorflow_OPTIMIZE_FOR_NATIVE_ARCH=OFF"
1400 "-Dtensorflow_ENABLE_SSL_SUPPORT=OFF"
1401 "-Dtensorflow_BUILD_CONTRIB_KERNELS=OFF"))
1404 #:modules ((ice-9 ftw)
1406 (guix build cmake-build-system))
1408 (modify-phases %standard-phases
1409 (add-after 'unpack 'set-source-file-times-to-1980
1410 ;; At the end of the tf_python_build_pip_package target, a ZIP
1411 ;; archive should be generated via bdist_wheel, but it fails with
1412 ;; "ZIP does not support timestamps before 1980". Luckily,
1413 ;; SOURCE_DATE_EPOCH is respected, which we set to some time in
1415 (lambda _ (setenv "SOURCE_DATE_EPOCH" "315532800") #t))
1416 ;; See https://github.com/tensorflow/tensorflow/issues/20517#issuecomment-406373913
1417 (add-after 'unpack 'python3.7-compatibility
1419 (substitute* '("tensorflow/python/eager/pywrap_tfe_src.cc"
1420 "tensorflow/python/lib/core/ndarray_tensor.cc"
1421 "tensorflow/python/lib/core/py_func.cc")
1422 (("PyUnicode_AsUTF8") "(char *)PyUnicode_AsUTF8"))
1423 (substitute* "tensorflow/c/eager/c_api.h"
1424 (("unsigned char async")
1425 "unsigned char is_async"))
1427 ;; Remove dependency on tensorboard, a complicated but probably
1428 ;; optional package.
1429 (substitute* "tensorflow/tools/pip_package/setup.py"
1430 ((".*'tensorboard >.*") ""))
1432 (add-after 'python3.7-compatibility 'chdir
1433 (lambda _ (chdir "tensorflow/contrib/cmake") #t))
1434 (add-after 'chdir 'disable-downloads
1435 (lambda* (#:key inputs #:allow-other-keys)
1436 (substitute* (find-files "external" "\\.cmake$")
1437 (("GIT_REPOSITORY.*") "")
1440 "DOWNLOAD_COMMAND \"\"\nPREFIX "))
1442 ;; Use packages from Guix
1443 (let ((grpc (assoc-ref inputs "grpc")))
1444 (substitute* "CMakeLists.txt"
1446 (("include\\(sqlite\\)") "")
1447 (("\\$\\{sqlite_STATIC_LIBRARIES\\}")
1448 (string-append (assoc-ref inputs "sqlite")
1449 "/lib/libsqlite3.so"))
1450 (("sqlite_copy_headers_to_destination") "")
1453 (("include\\(png\\)") "")
1454 (("\\$\\{png_STATIC_LIBRARIES\\}")
1455 (string-append (assoc-ref inputs "libpng")
1456 "/lib/libpng16.so"))
1457 (("png_copy_headers_to_destination") "")
1460 (("include\\(jpeg\\)") "")
1461 (("\\$\\{jpeg_STATIC_LIBRARIES\\}")
1462 (string-append (assoc-ref inputs "libjpeg")
1464 (("jpeg_copy_headers_to_destination") "")
1467 (("include\\(gif\\)") "")
1468 (("\\$\\{gif_STATIC_LIBRARIES\\}")
1469 (string-append (assoc-ref inputs "giflib")
1471 (("gif_copy_headers_to_destination") "")
1474 (("include\\(lmdb\\)") "")
1475 (("\\$\\{lmdb_STATIC_LIBRARIES\\}")
1476 (string-append (assoc-ref inputs "lmdb")
1478 (("lmdb_copy_headers_to_destination") "")
1481 (("include\\(protobuf\\)") "")
1482 (("protobuf_copy_headers_to_destination") "")
1483 (("^ +protobuf") "")
1486 (("include\\(grpc\\)")
1487 "find_package(grpc REQUIRED NAMES gRPC)")
1488 (("list\\(APPEND tensorflow_EXTERNAL_DEPENDENCIES grpc\\)") "")
1491 (("include\\(eigen\\)")
1492 (string-append "find_package(eigen REQUIRED NAMES Eigen3)
1493 set(eigen_INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR}/external/eigen_archive "
1494 (assoc-ref inputs "eigen") "/include/eigen3)"))
1498 (("include\\(snappy\\)")
1499 "add_definitions(-DTF_USE_SNAPPY)")
1500 (("list\\(APPEND tensorflow_EXTERNAL_DEPENDENCIES snappy\\)") "")
1503 (("include\\(jsoncpp\\)") "")
1504 (("^ +jsoncpp") ""))
1506 (substitute* "tf_core_framework.cmake"
1508 (("\\$\\{GRPC_BUILD\\}/grpc_cpp_plugin")
1509 (which "grpc_cpp_plugin"))
1510 ;; Link with gRPC libraries
1511 (("add_library\\(tf_protos_cc.*" m)
1513 (format #f "\ntarget_link_libraries(tf_protos_cc PRIVATE \
1514 ~a/lib/libgrpc++_unsecure.a \
1515 ~a/lib/libgrpc_unsecure.a \
1516 ~a/lib/libaddress_sorting.a \
1521 (assoc-ref inputs "c-ares"))))))
1522 (substitute* "tf_tools.cmake"
1523 (("add_dependencies\\(\\$\\{proto_text.*") ""))
1524 ;; Remove dependency on bundled grpc
1525 (substitute* "tf_core_distributed_runtime.cmake"
1526 (("tf_core_cpu grpc") "tf_core_cpu"))
1528 ;; This directory is a dependency of many targets.
1529 (mkdir-p "protobuf")
1531 (add-after 'configure 'unpack-third-party-sources
1532 (lambda* (#:key inputs #:allow-other-keys)
1533 ;; This is needed to configure bundled packages properly.
1534 (setenv "CONFIG_SHELL" (which "bash"))
1537 (let* ((what (assoc-ref inputs (string-append name "-src")))
1538 (name* (string-map (lambda (c)
1541 (where (string-append "../build/" name* "/src/" name*)))
1543 ((string-suffix? ".zip" what)
1545 (with-directory-excursion where
1546 (invoke "unzip" what)))
1547 ((string-suffix? ".tar.gz" what)
1549 (invoke "tar" "xf" what
1550 "-C" where "--strip-components=1"))
1552 (let ((parent (dirname where)))
1554 (with-directory-excursion parent
1555 (when (file-exists? name*)
1556 (delete-file-recursively name*))
1557 (copy-recursively what name*)
1558 (map make-file-writable
1559 (find-files name* ".*"))))))))
1569 (rename-file "../build/cub/src/cub/cub-1.8.0/"
1570 "../build/cub/src/cub/cub/")
1572 (add-after 'unpack 'fix-python-build
1573 (lambda* (#:key inputs outputs #:allow-other-keys)
1574 (mkdir-p "protobuf-src")
1575 (invoke "tar" "xf" (assoc-ref inputs "protobuf:src")
1576 "-C" "protobuf-src" "--strip-components=1")
1577 (mkdir-p "eigen-src")
1578 (invoke "tar" "xf" (assoc-ref inputs "eigen:src")
1579 "-C" "eigen-src" "--strip-components=1")
1581 (substitute* "tensorflow/contrib/cmake/tf_python.cmake"
1582 ;; Ensure that all Python dependencies can be found at build time.
1583 (("PYTHONPATH=\\$\\{CMAKE_CURRENT_BINARY_DIR\\}/tf_python" m)
1584 (string-append m ":" (getenv "PYTHONPATH")))
1585 ;; Take protobuf source files from our source package.
1586 (("\\$\\{CMAKE_CURRENT_BINARY_DIR\\}/protobuf/src/protobuf/src/google")
1587 (string-append (getcwd) "/protobuf-src/src/google")))
1589 (substitute* '("tensorflow/contrib/cmake/tf_shared_lib.cmake"
1590 "tensorflow/contrib/cmake/tf_python.cmake")
1591 ;; Take Eigen source files from our source package.
1592 (("\\$\\{CMAKE_CURRENT_BINARY_DIR\\}/eigen/src/eigen/")
1593 (string-append (getcwd) "/eigen-src/"))
1594 ;; Take Eigen headers from our own package.
1595 (("\\$\\{CMAKE_CURRENT_BINARY_DIR\\}/external/eigen_archive")
1596 (string-append (assoc-ref inputs "eigen") "/include/eigen3")))
1598 ;; Correct the RUNPATH of ops libraries generated for Python.
1599 ;; TODO: this doesn't work :(
1600 ;; /gnu/store/...-tensorflow-1.9.0/lib/python3.7/site-packages/tensorflow/contrib/seq2seq/python/ops/lib_beam_search_ops.so:
1601 ;; warning: RUNPATH contains bogus entries: ("/tmp/guix-build-tensorflow-1.9.0.drv-0/source/tensorflow/contrib/build")
1602 ;; /gnu/store/...-tensorflow-1.9.0/lib/python3.7/site-packages/tensorflow/contrib/seq2seq/python/ops/lib_beam_search_ops.so:
1603 ;; error: depends on 'libpywrap_tensorflow_internal.so', which
1604 ;; cannot be found in RUNPATH ...
1605 (substitute* "tensorflow/contrib/cmake/tf_cc_ops.cmake"
1606 (("set_target_properties.*")
1607 (string-append "set_target_properties(${_AT_TARGET} PROPERTIES \
1608 COMPILE_FLAGS ${target_compile_flags} \
1609 INSTALL_RPATH_USE_LINK_PATH TRUE \
1610 INSTALL_RPATH " (assoc-ref outputs "out") "/lib)\n")))
1612 (add-after 'build 'build-pip-package
1613 (lambda* (#:key outputs #:allow-other-keys)
1615 (string-append "-Wl,-rpath="
1616 (assoc-ref outputs "out") "/lib"))
1617 (invoke "make" "tf_python_build_pip_package")
1619 (add-after 'build-pip-package 'install-python
1620 (lambda* (#:key outputs #:allow-other-keys)
1621 (let ((out (assoc-ref outputs "out"))
1622 (wheel (car (find-files "../build/tf_python/dist/" "\\.whl$"))))
1623 (invoke "python" "-m" "pip" "install" wheel
1624 (string-append "--prefix=" out))
1626 ;; XXX: broken RUNPATH, see fix-python-build phase.
1629 out "/lib/python3.7/site-packages/tensorflow/contrib/"
1630 "seq2seq/python/ops/lib_beam_search_ops.so"))
1633 `(("pkg-config" ,pkg-config)
1634 ("protobuf:native" ,protobuf-3.6) ; protoc
1635 ("protobuf:src" ,(package-source protobuf-3.6))
1636 ("eigen:src" ,(package-source eigen-for-tensorflow))
1637 ;; install_pip_packages.sh wants setuptools 39.1.0 specifically.
1638 ("python-setuptools" ,python-setuptools-for-tensorflow)
1640 ;; The commit hashes and URLs for third-party source code are taken
1641 ;; from "tensorflow/workspace.bzl".
1643 ,(let ((commit "ee7aa02")
1648 (url "https://boringssl.googlesource.com/boringssl")
1650 (file-name (string-append "boringssl-0-" revision
1651 (string-take commit 7)
1655 "1jf693q0nw0adsic6cgmbdx6g7wr4rj4vxa8j1hpn792fqhd8wgw")))))
1657 ,(let ((version "1.8.0"))
1660 (uri (string-append "https://mirror.bazel.build/github.com/NVlabs/"
1661 "cub/archive/" version ".zip"))
1662 (file-name (string-append "cub-" version ".zip"))
1665 "1hsqikqridb90dkxkjr2918dcry6pfh46ccnwrzawl56aamhdykb")))))
1666 ("double-conversion-src"
1667 ,(let ((commit "5664746")
1672 (url "https://github.com/google/double-conversion.git")
1675 (git-file-name "double-conversion"
1676 (string-append "0-" revision "."
1677 (string-take commit 7))))
1680 "1h5lppqqxcvdg5jq42i5msgwx20ryij3apvmndflngrgdpc04gn1")))))
1682 ,(let ((commit "816a4ae622e964763ca0862d9dbd19324a1eaf45"))
1686 "https://mirror.bazel.build/github.com/google/farmhash/archive/"
1688 (file-name (string-append "farmhash-0-" (string-take commit 7)
1692 "185b2xdxl4d4cnsnv6abg8s22gxvx8673jq2yaq85bz4cdy58q35")))))
1693 ;; The license notice on the home page at
1694 ;; http://www.kurims.kyoto-u.ac.jp/~ooura/fft.html says:
1695 ;; Copyright Takuya OOURA, 1996-2001
1697 ;; You may use, copy, modify and distribute this code for any purpose
1698 ;; (include commercial use) and without fee. Please refer to this
1699 ;; package when you modify this code.
1701 ;; We take the identical tarball from the Bazel mirror, because the URL
1702 ;; at the home page is not versioned and might change.
1706 (uri "https://mirror.bazel.build/www.kurims.kyoto-u.ac.jp/~ooura/fft.tgz")
1707 (file-name "fft2d.tar.gz")
1710 "15jjkfvhqvl2c0753d2di8hz0pyzn598g74wqy79awdrf1y67fsj"))))
1712 ,(let ((commit "be5edafc2e1a455768e260ccd68ae7317b6690ee")
1717 (url "https://github.com/google/highwayhash.git")
1719 (file-name (string-append "highwayhash-0-" revision
1720 (string-take commit 7)
1724 "154jwf98cyy54hldr94pgjn85zynly3abpnc1avmb8a18lzwjyb6")))))
1726 ,(let ((version "0559ce013feac8db639ee1bf776aca0325d28777")
1730 (uri (string-append "https://mirror.bazel.build/"
1731 "github.com/google/nsync/archive/"
1733 (file-name (string-append "nsync-0." revision
1734 "-" (string-take version 7)
1738 "0qdkyqym34x739mmzv97ah5r7ph462v5xkxqxvidmcfqbi64b132")))))
1740 ,(let ((commit "e7efc48")
1745 (url "https://github.com/google/re2")
1747 (file-name (string-append "re2-0-" revision
1748 (string-take commit 7)
1752 "161g9841rjfsy5pn52fcis0s9hdr7rxvb06pad38j5rppfihvign")))))
1753 ("googletest" ,googletest)
1757 `(("python-absl-py" ,python-absl-py)
1758 ("python-astor" ,python-astor)
1759 ("python-gast" ,python-gast)
1760 ("python-grpcio" ,python-grpcio)
1761 ("python-numpy" ,python-numpy)
1762 ("python-protobuf" ,python-protobuf-3.6)
1763 ("python-six" ,python-six)
1764 ("python-termcolo" ,python-termcolor)
1765 ("python-wheel" ,python-wheel)))
1767 `(("c-ares" ,c-ares)
1768 ("eigen" ,eigen-for-tensorflow)
1769 ("gemmlowp" ,gemmlowp-for-tensorflow)
1771 ("libjpeg" ,libjpeg-turbo)
1774 ("grpc" ,grpc-1.16.1 "static")
1775 ("grpc:bin" ,grpc-1.16.1)
1776 ("jsoncpp" ,jsoncpp-for-tensorflow)
1779 ("protobuf" ,protobuf-3.6)
1780 ("python" ,python-wrapper)
1782 (home-page "https://tensorflow.org")
1783 (synopsis "Machine learning framework")
1785 "TensorFlow is a flexible platform for building and training machine
1786 learning models. It provides a library for high performance numerical
1787 computation and includes high level Python APIs, including both a sequential
1788 API for beginners that allows users to build models quickly by plugging
1789 together building blocks and a subclassing API with an imperative style for
1790 advanced research.")
1791 (license license:asl2.0)))
1793 (define-public python-iml
1800 (uri (pypi-uri "iml" version))
1803 "1k8szlpm19rcwcxdny9qdm3gmaqq8akb4xlvrzyz8c2d679aak6l"))))
1804 (build-system python-build-system)
1806 `(("ipython" ,python-ipython)
1807 ("nose" ,python-nose)
1808 ("numpy" ,python-numpy)
1809 ("pandas" ,python-pandas)
1810 ("scipy" ,python-scipy)))
1811 (home-page "http://github.com/interpretable-ml/iml")
1812 (synopsis "Interpretable Machine Learning (iML) package")
1813 (description "Interpretable ML (iML) is a set of data type objects,
1814 visualizations, and interfaces that can be used by any method designed to
1815 explain the predictions of machine learning models (or really the output of
1816 any function). It currently contains the interface and IO code from the Shap
1817 project, and it will potentially also do the same for the Lime project.")
1818 (license license:expat)))
1820 (define-public python-keras-applications
1822 (name "python-keras-applications")
1827 (uri (pypi-uri "Keras_Applications" version))
1830 "1rcz31ca4axa6kzhjx4lwqxbg4wvlljkj8qj9a7p9sfd5fhzjyam"))))
1831 (build-system python-build-system)
1832 ;; The tests require Keras, but this package is needed to build Keras.
1833 (arguments '(#:tests? #f))
1835 `(("python-h5py" ,python-h5py)
1836 ("python-numpy" ,python-numpy)))
1838 `(("python-pytest" ,python-pytest)
1839 ("python-pytest-cov" ,python-pytest-cov)
1840 ("python-pytest-pep8" ,python-pytest-pep8)
1841 ("python-pytest-xdist" ,python-pytest-xdist)))
1842 (home-page "https://github.com/keras-team/keras-applications")
1843 (synopsis "Reference implementations of popular deep learning models")
1845 "This package provides reference implementations of popular deep learning
1846 models for use with the Keras deep learning framework.")
1847 (license license:expat)))
1849 (define-public python-keras-preprocessing
1851 (name "python-keras-preprocessing")
1856 (uri (pypi-uri "Keras_Preprocessing" version))
1859 "1r98nm4k1svsqjyaqkfk23i31bl1kcfcyp7094yyj3c43phfp3as"))))
1860 (build-system python-build-system)
1862 `(("python-numpy" ,python-numpy)
1863 ("python-six" ,python-six)))
1865 `(("python-pandas" ,python-pandas)
1866 ("python-pillow" ,python-pillow)
1867 ("python-pytest" ,python-pytest)
1868 ("python-pytest-cov" ,python-pytest-cov)
1869 ("python-pytest-xdist" ,python-pytest-xdist)
1870 ("tensorflow" ,tensorflow)))
1871 (home-page "https://github.com/keras-team/keras-preprocessing/")
1872 (synopsis "Data preprocessing and augmentation for deep learning models")
1874 "Keras Preprocessing is the data preprocessing and data augmentation
1875 module of the Keras deep learning library. It provides utilities for working
1876 with image data, text data, and sequence data.")
1877 (license license:expat)))
1879 (define-public python-keras
1881 (name "python-keras")
1886 (uri (pypi-uri "Keras" version))
1887 (patches (search-patches "python-keras-integration-test.patch"))
1890 "1j8bsqzh49vjdxy6l1k4iwax5vpjzniynyd041xjavdzvfii1dlh"))))
1891 (build-system python-build-system)
1894 (modify-phases %standard-phases
1895 (add-after 'unpack 'remove-tests-for-unavailable-features
1897 (delete-file "keras/backend/theano_backend.py")
1898 (delete-file "keras/backend/cntk_backend.py")
1899 (delete-file "tests/keras/backend/backend_test.py")
1901 ;; FIXME: This doesn't work because Tensorflow is missing the
1902 ;; coder ops library.
1903 (delete-file "tests/keras/test_callbacks.py")
1907 ;; These tests attempt to download data files from the internet.
1908 (delete-file "tests/integration_tests/test_datasets.py")
1909 (delete-file "tests/integration_tests/imagenet_utils_test.py")
1911 (setenv "PYTHONPATH"
1912 (string-append (getcwd) "/build/lib:"
1913 (getenv "PYTHONPATH")))
1914 (invoke "py.test" "-v"
1915 "-p" "no:cacheprovider"
1916 "--ignore" "keras/utils"))))))
1918 `(("python-h5py" ,python-h5py)
1919 ("python-keras-applications" ,python-keras-applications)
1920 ("python-keras-preprocessing" ,python-keras-preprocessing)
1921 ("python-numpy" ,python-numpy)
1922 ("python-pydot" ,python-pydot)
1923 ("python-pyyaml" ,python-pyyaml)
1924 ("python-scipy" ,python-scipy)
1925 ("python-six" ,python-six)
1926 ("tensorflow" ,tensorflow)
1927 ("graphviz" ,graphviz)))
1929 `(("python-pandas" ,python-pandas)
1930 ("python-pytest" ,python-pytest)
1931 ("python-pytest-cov" ,python-pytest-cov)
1932 ("python-pytest-pep8" ,python-pytest-pep8)
1933 ("python-pytest-timeout" ,python-pytest-timeout)
1934 ("python-pytest-xdist" ,python-pytest-xdist)
1935 ("python-sphinx" ,python-sphinx)
1936 ("python-requests" ,python-requests)))
1937 (home-page "https://github.com/keras-team/keras")
1938 (synopsis "High-level deep learning framework")
1939 (description "Keras is a high-level neural networks API, written in Python
1940 and capable of running on top of TensorFlow. It was developed with a focus on
1941 enabling fast experimentation. Use Keras if you need a deep learning library
1945 @item Allows for easy and fast prototyping (through user friendliness,
1946 modularity, and extensibility).
1947 @item Supports both convolutional networks and recurrent networks, as well as
1948 combinations of the two.
1949 @item Runs seamlessly on CPU and GPU.
1951 (license license:expat)))
1953 (define-public sbcl-cl-libsvm-format
1954 (let ((commit "3300f84fd8d9f5beafc114f543f9d83417c742fb")
1957 (name "sbcl-cl-libsvm-format")
1958 (version (git-version "0.1.0" revision commit))
1963 (url "https://github.com/masatoi/cl-libsvm-format.git")
1965 (file-name (git-file-name name version))
1968 "0284aj84xszhkhlivaigf9qj855fxad3mzmv3zfr0qzb5k0nzwrg"))))
1969 (build-system asdf-build-system/sbcl)
1971 `(("prove" ,sbcl-prove)
1972 ("prove-asdf" ,sbcl-prove-asdf)))
1974 `(("alexandria" ,sbcl-alexandria)))
1975 (synopsis "LibSVM data format reader for Common Lisp")
1977 "This Common Lisp library provides a fast reader for data in LibSVM
1979 (home-page "https://github.com/masatoi/cl-libsvm-format")
1980 (license license:expat))))
1982 (define-public cl-libsvm-format
1983 (sbcl-package->cl-source-package sbcl-cl-libsvm-format))
1985 (define-public ecl-cl-libsvm-format
1986 (sbcl-package->ecl-package sbcl-cl-libsvm-format))
1988 (define-public sbcl-cl-online-learning
1989 (let ((commit "fc7a34f4f161cd1c7dd747d2ed8f698947781423")
1992 (name "sbcl-cl-online-learning")
1993 (version (git-version "0.5" revision commit))
1998 (url "https://github.com/masatoi/cl-online-learning.git")
2000 (file-name (git-file-name name version))
2003 "14x95rlg80ay5hv645ki57pqvy12v28hz4k1w0f6bsfi2rmpxchq"))))
2004 (build-system asdf-build-system/sbcl)
2006 `(("prove" ,sbcl-prove)
2007 ("prove-asdf" ,sbcl-prove-asdf)))
2009 `(("cl-libsvm-format" ,sbcl-cl-libsvm-format)
2010 ("cl-store" ,sbcl-cl-store)))
2012 `(;; FIXME: Tests pass but then the check phase crashes
2014 (synopsis "Online Machine Learning for Common Lisp")
2016 "This library contains a collection of machine learning algorithms for
2017 online linear classification written in Common Lisp.")
2018 (home-page "https://github.com/masatoi/cl-online-learning")
2019 (license license:expat))))
2021 (define-public cl-online-learning
2022 (sbcl-package->cl-source-package sbcl-cl-online-learning))
2024 (define-public ecl-cl-online-learning
2025 (sbcl-package->ecl-package sbcl-cl-online-learning))
2027 (define-public sbcl-cl-random-forest
2028 (let ((commit "85fbdd4596d40e824f70f1b7cf239cf544e49d51")
2031 (name "sbcl-cl-random-forest")
2032 (version (git-version "0.1" revision commit))
2037 (url "https://github.com/masatoi/cl-random-forest.git")
2039 (file-name (git-file-name name version))
2042 "097xv60i1ndz68sg9p4pc7c5gvyp9i1xgw966b4wwfq3x6hbz421"))))
2043 (build-system asdf-build-system/sbcl)
2045 `(("prove" ,sbcl-prove)
2046 ("prove-asdf" ,sbcl-prove-asdf)
2047 ("trivial-garbage" ,sbcl-trivial-garbage)))
2049 `(("alexandria" ,sbcl-alexandria)
2050 ("cl-libsvm-format" ,sbcl-cl-libsvm-format)
2051 ("cl-online-learning" ,sbcl-cl-online-learning)
2052 ("lparallel" ,sbcl-lparallel)))
2054 `(;; The tests download data from the Internet
2057 (modify-phases %standard-phases
2058 (add-after 'unpack 'add-sb-cltl2-dependency
2060 ;; sb-cltl2 is required by lparallel when using sbcl, but it is
2061 ;; not loaded automatically.
2062 (substitute* "cl-random-forest.asd"
2063 (("\\(in-package :cl-user\\)")
2064 "(in-package :cl-user) #+sbcl (require :sb-cltl2)"))
2066 (synopsis "Random Forest and Global Refinement for Common Lisp")
2068 "CL-random-forest is an implementation of Random Forest for multiclass
2069 classification and univariate regression written in Common Lisp. It also
2070 includes an implementation of Global Refinement of Random Forest.")
2071 (home-page "https://github.com/masatoi/cl-random-forest")
2072 (license license:expat))))
2074 (define-public cl-random-forest
2075 (sbcl-package->cl-source-package sbcl-cl-random-forest))
2077 (define-public ecl-cl-random-forest
2078 (sbcl-package->ecl-package sbcl-cl-random-forest))
2081 (let ((version "0.0.0") ; no proper version tag
2082 (commit "ca528e32fea9ca8f2b16053cff17160290fc84ce")
2086 (version (git-version version revision commit))
2091 (url "https://github.com/facebookincubator/gloo.git")
2093 (file-name (git-file-name name version))
2096 "1q9f80zy75f6njrzrqkmhc0g3qxs4gskr7ns2jdqanxa2ww7a99w"))))
2097 (build-system cmake-build-system)
2099 `(("googletest" ,googletest)))
2101 `(#:configure-flags '("-DBUILD_TEST=1")
2103 (modify-phases %standard-phases
2106 (invoke "make" "gloo_test")
2108 (synopsis "Collective communications library")
2110 "Gloo is a collective communications library. It comes with a
2111 number of collective algorithms useful for machine learning applications.
2112 These include a barrier, broadcast, and allreduce.")
2113 (home-page "https://github.com/facebookincubator/gloo")
2114 (license license:bsd-3))))
2116 (define-public python-umap-learn
2118 (name "python-umap-learn")
2123 (uri (pypi-uri "umap-learn" version))
2126 "02ada2yy6km6zgk2836kg1c97yrcpalvan34p8c57446finnpki1"))))
2127 (build-system python-build-system)
2129 `(("python-joblib" ,python-joblib)
2130 ("python-nose" ,python-nose)))
2132 `(("python-numba" ,python-numba)
2133 ("python-numpy" ,python-numpy)
2134 ("python-scikit-learn" ,python-scikit-learn)
2135 ("python-scipy" ,python-scipy)))
2136 (home-page "https://github.com/lmcinnes/umap")
2138 "Uniform Manifold Approximation and Projection")
2140 "Uniform Manifold Approximation and Projection is a dimension reduction
2141 technique that can be used for visualisation similarly to t-SNE, but also for
2142 general non-linear dimension reduction.")
2143 (license license:bsd-3)))