1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015, 2016, 2017, 2018 Ricardo Wurmus <rekado@elephly.net>
3 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
4 ;;; Copyright © 2016, 2017 Marius Bakke <mbakke@fastmail.com>
5 ;;; Copyright © 2016 Hartmut Goebel <h.goebel@crazy-compilers.com>
6 ;;; Copyright © 2018 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>
12 ;;; This file is part of GNU Guix.
14 ;;; GNU Guix is free software; you can redistribute it and/or modify it
15 ;;; under the terms of the GNU General Public License as published by
16 ;;; the Free Software Foundation; either version 3 of the License, or (at
17 ;;; your option) any later version.
19 ;;; GNU Guix is distributed in the hope that it will be useful, but
20 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
21 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 ;;; GNU General Public License for more details.
24 ;;; You should have received a copy of the GNU General Public License
25 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
27 (define-module (gnu packages machine-learning)
28 #:use-module ((guix licenses) #:prefix license:)
29 #:use-module (guix packages)
30 #:use-module (guix utils)
31 #:use-module (guix download)
32 #:use-module (guix svn-download)
33 #:use-module (guix build-system cmake)
34 #:use-module (guix build-system gnu)
35 #:use-module (guix build-system ocaml)
36 #:use-module (guix build-system python)
37 #:use-module (guix build-system r)
38 #:use-module (guix git-download)
39 #:use-module (gnu packages)
40 #:use-module (gnu packages algebra)
41 #:use-module (gnu packages autotools)
42 #:use-module (gnu packages boost)
43 #:use-module (gnu packages check)
44 #:use-module (gnu packages compression)
45 #:use-module (gnu packages cran)
46 #:use-module (gnu packages dejagnu)
47 #:use-module (gnu packages gcc)
48 #:use-module (gnu packages image)
49 #:use-module (gnu packages maths)
50 #:use-module (gnu packages ocaml)
51 #:use-module (gnu packages perl)
52 #:use-module (gnu packages pkg-config)
53 #:use-module (gnu packages python)
54 #:use-module (gnu packages statistics)
55 #:use-module (gnu packages swig)
56 #:use-module (gnu packages xml)
57 #:use-module (gnu packages xorg))
60 ;; The last release is >100 commits behind, so we package from git.
61 (let ((commit "d71d54788bee56ba4cf7522801270152da5209d7"))
64 (version (string-append "2.2.0-1." (string-take commit 8)))
68 (url "https://github.com/libfann/fann.git")
70 (file-name (string-append name "-" version "-checkout"))
73 "0ibwpfrjs6q2lijs8slxjgzb2llcl6rk3v2ski4r6215g5jjhg3x"))))
74 (build-system cmake-build-system)
77 (modify-phases %standard-phases
79 (lambda* (#:key outputs #:allow-other-keys)
80 (let* ((out (assoc-ref outputs "out")))
81 (with-directory-excursion (string-append (getcwd) "/tests")
82 (invoke "./fann_tests"))))))))
83 (home-page "http://leenissen.dk/fann/wp/")
84 (synopsis "Fast Artificial Neural Network")
86 "FANN is a free open source neural network library, which implements
87 multilayer artificial neural networks in C with support for both fully
88 connected and sparsely connected networks.")
89 (license license:lgpl2.1))))
98 (uri (string-append "https://www.csie.ntu.edu.tw/~cjlin/libsvm/"
99 name "-" version ".tar.gz"))
102 "0zd7s19y5vb7agczl6456bn45cj1y64739sslaskw1qk7dywd0bd"))))
103 (build-system gnu-build-system)
105 `(#:tests? #f ;no "check" target
106 #:phases (modify-phases %standard-phases
109 'install ; no ‘install’ target
110 (lambda* (#:key outputs #:allow-other-keys)
111 (let* ((out (assoc-ref outputs "out"))
112 (bin (string-append out "/bin/")))
114 (for-each (lambda (file)
115 (copy-file file (string-append bin file)))
120 (home-page "http://www.csie.ntu.edu.tw/~cjlin/libsvm/")
121 (synopsis "Library for Support Vector Machines")
123 "LIBSVM is a machine learning library for support vector
124 classification, (C-SVC, nu-SVC), regression (epsilon-SVR, nu-SVR) and
125 distribution estimation (one-class SVM). It supports multi-class
127 (license license:bsd-3)))
129 (define-public python-libsvm
130 (package (inherit libsvm)
131 (name "python-libsvm")
132 (build-system gnu-build-system)
134 `(#:tests? #f ;no "check" target
135 #:make-flags '("-C" "python")
137 (modify-phases %standard-phases
140 'install ; no ‘install’ target
141 (lambda* (#:key inputs outputs #:allow-other-keys)
142 (let ((site (string-append (assoc-ref outputs "out")
146 (assoc-ref inputs "python") 5) 3)
148 (substitute* "python/svm.py"
149 (("../libsvm.so.2") "libsvm.so.2"))
151 (for-each (lambda (file)
152 (copy-file file (string-append site (basename file))))
153 (find-files "python" "\\.py"))
154 (copy-file "libsvm.so.2"
155 (string-append site "libsvm.so.2")))
158 `(("python" ,python)))
159 (synopsis "Python bindings of libSVM")))
162 ;; The latest release candidate is several years and a couple of fixes have
163 ;; been published since. This is why we download the sources from the SVN
165 (let ((svn-revision 2341))
168 (version (string-append "0.9-rc3-0." (number->string svn-revision)))
172 (url "http://svn.code.sf.net/p/ghmm/code/trunk")
173 (revision svn-revision)))
174 (file-name (string-append name "-" version))
177 "0qbq1rqp94l530f043qzp8aw5lj7dng9wq0miffd7spd1ff638wq"))))
178 (build-system gnu-build-system)
180 `(#:imported-modules (,@%gnu-build-system-modules
181 (guix build python-build-system))
183 (modify-phases %standard-phases
184 (add-after 'unpack 'enter-dir
185 (lambda _ (chdir "ghmm") #t))
187 (add-after 'install 'check
188 (assoc-ref %standard-phases 'check))
189 (add-before 'check 'fix-PYTHONPATH
190 (lambda* (#:key inputs outputs #:allow-other-keys)
191 (let ((python-version ((@@ (guix build python-build-system)
193 (assoc-ref inputs "python"))))
195 (string-append (getenv "PYTHONPATH")
196 ":" (assoc-ref outputs "out")
197 "/lib/python" python-version
200 (add-after 'enter-dir 'fix-runpath
201 (lambda* (#:key outputs #:allow-other-keys)
202 (substitute* "ghmmwrapper/setup.py"
203 (("^(.*)extra_compile_args = \\[" line indent)
204 (string-append indent
205 "extra_link_args = [\"-Wl,-rpath="
206 (assoc-ref outputs "out") "/lib\"],\n"
209 (assoc-ref outputs "out")
212 (add-after 'enter-dir 'disable-broken-tests
214 (substitute* "tests/Makefile.am"
215 ;; GHMM_SILENT_TESTS is assumed to be a command.
216 (("TESTS_ENVIRONMENT.*") "")
217 ;; Do not build broken tests.
221 (("label_higher_order_test.*$")
222 "label_higher_order_test\n"))
224 ;; These Python unittests are broken as there is no gato.
225 ;; See https://sourceforge.net/p/ghmm/support-requests/3/
226 (substitute* "ghmmwrapper/ghmmunittests.py"
227 (("^(.*)def (testNewXML|testMultipleTransitionClasses|testNewXML)"
229 (string-append indent
230 "@unittest.skip(\"Disabled by Guix\")\n"
233 (add-after 'disable-broken-tests 'autogen
235 (zero? (system* "bash" "autogen.sh")))))))
237 `(("python" ,python-2) ; only Python 2 is supported
238 ("libxml2" ,libxml2)))
240 `(("pkg-config" ,pkg-config)
243 ("autoconf" ,autoconf)
244 ("automake" ,automake)
245 ("libtool" ,libtool)))
246 (home-page "http://ghmm.org")
247 (synopsis "Hidden Markov Model library")
249 "The General Hidden Markov Model library (GHMM) is a C library with
250 additional Python bindings implementing a wide range of types of @dfn{Hidden
251 Markov Models} (HMM) and algorithms: discrete, continuous emissions, basic
252 training, HMM clustering, HMM mixtures.")
253 (license license:lgpl2.0+))))
262 "http://micans.org/mcl/src/mcl-"
263 (string-replace-substring version "." "-")
267 "15xlax3z31lsn62vlg94hkm75nm40q4679amnfg13jm8m2bnhy5m"))))
268 (build-system gnu-build-system)
270 `(#:configure-flags (list "--enable-blast")))
273 (home-page "http://micans.org/mcl/")
274 (synopsis "Clustering algorithm for graphs")
276 "The MCL algorithm is short for the @dfn{Markov Cluster Algorithm}, a
277 fast and scalable unsupervised cluster algorithm for graphs (also known as
278 networks) based on simulation of (stochastic) flow in graphs.")
279 ;; In the LICENCE file and web page it says "The software is licensed
280 ;; under the GNU General Public License, version 3.", but in several of
281 ;; the source code files it suggests GPL3 or later.
282 ;; http://listserver.ebi.ac.uk/pipermail/mcl-users/2016/000376.html
283 (license license:gpl3)))
285 (define-public ocaml-mcl
288 (version "12-068oasis4")
293 "https://github.com/fhcrc/mcl/archive/"
295 (file-name (string-append name "-" version ".tar.gz"))
298 "1l5jbhwjpsj38x8b9698hfpkv75h8hn3kj0gihjhn8ym2cwwv110"))))
299 (build-system ocaml-build-system)
302 (modify-phases %standard-phases
303 (add-before 'configure 'patch-paths
305 (substitute* "configure"
306 (("SHELL = /bin/sh") (string-append "SHELL = "(which "sh"))))
307 (substitute* "setup.ml"
309 (string-append "LDFLAGS=-fPIC\"; \"SHELL=" (which "sh"))))
311 (home-page "https://github.com/fhcrc/mcl")
312 (synopsis "OCaml wrappers around MCL")
314 "This package provides OCaml bindings for the MCL graph clustering
316 (license license:gpl3)))
318 (define-public ocaml4.01-mcl
319 (package-with-ocaml4.01 ocaml-mcl))
321 (define-public randomjungle
323 (name "randomjungle")
329 "http://www.imbs-luebeck.de/imbs/sites/default/files/u59/"
330 "randomjungle-" version ".tar_.gz"))
333 "12c8rf30cla71swx2mf4ww9mfd8jbdw5lnxd7dxhyw1ygrvg6y4w"))))
334 (build-system gnu-build-system)
337 (list (string-append "--with-boost="
338 (assoc-ref %build-inputs "boost")))
340 (modify-phases %standard-phases
342 'configure 'set-CXXFLAGS
344 (setenv "CXXFLAGS" "-fpermissive ")
352 `(("gfortran" ,gfortran)
353 ("gfortran:lib" ,gfortran "lib")))
354 ;; Non-portable assembly instructions are used so building fails on
355 ;; platforms other than x86_64 or i686.
356 (supported-systems '("x86_64-linux" "i686-linux"))
357 (home-page "http://www.imbs-luebeck.de/imbs/de/node/227/")
358 (synopsis "Implementation of the Random Forests machine learning method")
360 "Random Jungle is an implementation of Random Forests. It is supposed to
361 analyse high dimensional data. In genetics, it can be used for analysing big
362 Genome Wide Association (GWA) data. Random Forests is a powerful machine
363 learning method. Most interesting features are variable selection, missing
364 value imputation, classifier creation, generalization error estimation and
365 sample proximities between pairs of cases.")
366 (license license:gpl3+)))
368 (define-public shogun
376 "ftp://shogun-toolbox.org/shogun/releases/"
377 (version-major+minor version)
378 "/sources/shogun-" version ".tar.bz2"))
381 "1rn9skm3nw6hr7mr3lgp2gfqhi7ii0lyxck7qmqnf8avq349s5jp"))
382 (modules '((guix build utils)
386 ;; Remove non-free sources and files referencing them
387 (for-each delete-file
388 (find-files "src/shogun/classifier/svm/"
389 "SVMLight\\.(cpp|h)"))
390 (for-each delete-file
391 (find-files "examples/undocumented/libshogun/"
393 "(classifier_.*svmlight.*|"
394 "evaluation_cross_validation_locked_comparison).cpp")))
395 ;; Remove non-free functions.
396 (define (delete-ifdefs file)
397 (with-atomic-file-replacement file
399 (let loop ((line (read-line in 'concat))
401 (if (eof-object? line)
406 "#endif //USE_SVMLIGHT" line)))
408 "#ifdef USE_SVMLIGHT" line))))
409 (when (or (not skipping?)
410 (and skipping? (not skip-next?)))
412 (loop (read-line in 'concat) skip-next?)))))))
413 (for-each delete-ifdefs
415 (find-files "src/shogun/classifier/mkl"
416 "^MKLClassification\\.cpp")
417 (find-files "src/shogun/classifier/svm"
418 "^SVMLightOneClass\\.(cpp|h)")
419 (find-files "src/shogun/multiclass"
420 "^ScatterSVM\\.(cpp|h)")
421 (find-files "src/shogun/kernel/"
422 "^(Kernel|CombinedKernel|ProductKernel)\\.(cpp|h)")
423 (find-files "src/shogun/regression/svr"
424 "^(MKLRegression|SVRLight)\\.(cpp|h)")
425 (find-files "src/shogun/transfer/domain_adaptation"
426 "^DomainAdaptationSVM\\.(cpp|h)")))
428 (build-system cmake-build-system)
430 '(#:tests? #f ;no check target
432 (modify-phases %standard-phases
433 (add-after 'unpack 'delete-broken-symlinks
435 (for-each delete-file '("applications/arts/data"
436 "applications/asp/data"
437 "applications/easysvm/data"
438 "applications/msplicer/data"
439 "applications/ocr/data"
441 "examples/undocumented/data"))
443 (add-after 'unpack 'change-R-target-path
444 (lambda* (#:key outputs #:allow-other-keys)
445 (substitute* '("src/interfaces/r/CMakeLists.txt"
446 "examples/meta/r/CMakeLists.txt")
447 (("\\$\\{R_COMPONENT_LIB_PATH\\}")
448 (string-append (assoc-ref outputs "out")
451 (add-after 'unpack 'fix-octave-modules
452 (lambda* (#:key outputs #:allow-other-keys)
453 (substitute* "src/interfaces/octave/CMakeLists.txt"
454 (("^include_directories\\(\\$\\{OCTAVE_INCLUDE_DIRS\\}")
455 "include_directories(${OCTAVE_INCLUDE_DIRS} ${OCTAVE_INCLUDE_DIRS}/octave")
456 ;; change target directory
457 (("\\$\\{OCTAVE_OCT_LOCAL_API_FILE_DIR\\}")
458 (string-append (assoc-ref outputs "out")
459 "/share/octave/packages")))
460 (substitute* '("src/interfaces/octave/swig_typemaps.i"
461 "src/interfaces/octave/sg_print_functions.cpp")
462 ;; "octave/config.h" and "octave/oct-obj.h" deprecated in Octave.
463 (("octave/config\\.h") "octave/octave-config.h")
464 (("octave/oct-obj.h") "octave/ovl.h"))
466 (add-after 'unpack 'move-rxcpp
467 (lambda* (#:key inputs #:allow-other-keys)
468 (let ((rxcpp-dir "shogun/third-party/rxcpp"))
470 (install-file (assoc-ref inputs "rxcpp") rxcpp-dir)
472 (add-before 'build 'set-HOME
473 ;; $HOME needs to be set at some point during the build phase
474 (lambda _ (setenv "HOME" "/tmp") #t)))
476 (list "-DCMAKE_BUILD_WITH_INSTALL_RPATH=TRUE"
477 "-DUSE_SVMLIGHT=OFF" ;disable proprietary SVMLIGHT
478 "-DBUILD_META_EXAMPLES=OFF" ;requires unpackaged ctags
479 ;;"-DINTERFACE_JAVA=ON" ;requires unpackaged jblas
480 ;;"-DINTERFACE_RUBY=ON" ;requires unpackaged ruby-narray
481 ;;"-DINTERFACE_PERL=ON" ;"FindPerlLibs" does not exist
482 ;;"-DINTERFACE_LUA=ON" ;fails because lua doesn't build pkgconfig file
483 "-DINTERFACE_OCTAVE=ON"
484 "-DINTERFACE_PYTHON=ON"
485 "-DINTERFACE_R=ON")))
488 ("numpy" ,python-numpy)
489 ("r-minimal" ,r-minimal)
495 ("arpack" ,arpack-ng)
502 `(("pkg-config" ,pkg-config)
504 ;; Non-portable SSE instructions are used so building fails on platforms
505 ;; other than x86_64.
506 (supported-systems '("x86_64-linux"))
507 (home-page "http://shogun-toolbox.org/")
508 (synopsis "Machine learning toolbox")
510 "The Shogun Machine learning toolbox provides a wide range of unified and
511 efficient Machine Learning (ML) methods. The toolbox seamlessly allows to
512 combine multiple data representations, algorithm classes, and general purpose
513 tools. This enables both rapid prototyping of data pipelines and extensibility
514 in terms of new algorithms.")
515 (license license:gpl3+)))
524 (uri (string-append "https://github.com/ReactiveX/RxCpp/archive/v"
528 "0y2isr8dy2n1yjr9c5570kpc9lvdlch6jv0jvw000amwn5d3krsh"))
529 (file-name (string-append name "-" version ".tar.gz"))))
530 (build-system cmake-build-system)
533 (modify-phases %standard-phases
534 (add-after 'unpack 'remove-werror
536 (substitute* (find-files ".")
541 (invoke "ctest"))))))
543 `(("catch" ,catch-framework)))
544 (home-page "http://reactivex.io/")
545 (synopsis "Reactive Extensions for C++")
547 "The Reactive Extensions for C++ (RxCpp) is a library of algorithms for
548 values-distributed-in-time. ReactiveX is a library for composing asynchronous
549 and event-based programs by using observable sequences.
551 It extends the observer pattern to support sequences of data and/or events and
552 adds operators that allow you to compose sequences together declaratively while
553 abstracting away concerns about things like low-level threading,
554 synchronization, thread-safety, concurrent data structures, and non-blocking
556 (license license:asl2.0)))
558 (define-public r-adaptivesparsity
560 (name "r-adaptivesparsity")
564 (uri (cran-uri "AdaptiveSparsity" version))
567 "1az7isvalf3kmdiycrfl6s9k9xqk22k1mc6rh8v0jmcz402qyq8z"))))
569 `((upstream-name . "AdaptiveSparsity")))
570 (build-system r-build-system)
573 (modify-phases %standard-phases
574 (add-after 'unpack 'link-against-armadillo
576 (substitute* "src/Makevars"
577 (("PKG_LIBS=" prefix)
578 (string-append prefix "-larmadillo"))))))))
581 ("r-rcpparmadillo" ,r-rcpparmadillo)))
583 `(("armadillo" ,armadillo)))
584 (home-page "https://cran.r-project.org/web/packages/AdaptiveSparsity")
585 (synopsis "Adaptive sparsity models")
587 "This package implements the Figueiredo machine learning algorithm for
588 adaptive sparsity and the Wong algorithm for adaptively sparse gaussian
590 (license license:lgpl3+)))
592 (define-public r-kernlab
599 (uri (cran-uri "kernlab" version))
602 "0xv0slf3ggw3sswsi34416lb1g3h1pqkrr2h7r1n1kvgii3l0jcm"))))
603 (build-system r-build-system)
604 (home-page "https://cran.r-project.org/web/packages/kernlab")
605 (synopsis "Kernel-based machine learning tools")
607 "This package provides kernel-based machine learning methods for
608 classification, regression, clustering, novelty detection, quantile regression
609 and dimensionality reduction. Among other methods @code{kernlab} includes
610 Support Vector Machines, Spectral Clustering, Kernel PCA, Gaussian Processes
612 (license license:gpl2)))
621 "http://dlib.net/files/dlib-" version ".tar.bz2"))
624 "1mljz02kwkrbggyncxv5fpnyjdybw2qihaacb3js8yfkw12vwpc2"))
625 (modules '((guix build utils)))
628 ;; Delete ~13MB of bundled dependencies.
629 (delete-file-recursively "dlib/external")
630 (delete-file-recursively "docs/dlib/external")
632 (build-system cmake-build-system)
635 (modify-phases %standard-phases
636 (add-after 'unpack 'disable-asserts
638 ;; config.h recommends explicitly enabling or disabling asserts
639 ;; when building as a shared library. By default neither is set.
640 (substitute* "dlib/config.h"
641 (("^//#define DLIB_DISABLE_ASSERTS") "#define DLIB_DISABLE_ASSERTS"))
643 (add-after 'disable-asserts 'disable-failing-tests
645 ;; One test times out on MIPS, so we need to disable it.
646 ;; Others are flaky on some platforms.
647 (let* ((system ,(or (%current-target-system)
649 (disabled-tests (cond
650 ((string-prefix? "mips64" system)
651 '("object_detector" ; timeout
653 ((string-prefix? "armhf" system)
654 '("learning_to_track"))
655 ((string-prefix? "i686" system)
660 (substitute* "dlib/test/makefile"
661 (((string-append "SRC \\+= " test "\\.cpp")) "")))
666 ;; No test target, so we build and run the unit tests here.
667 (let ((test-dir (string-append "../dlib-" ,version "/dlib/test")))
668 (with-directory-excursion test-dir
669 (and (zero? (system* "make" "-j" (number->string (parallel-job-count))))
670 (zero? (system* "./dtest" "--runall")))))))
671 (add-after 'install 'delete-static-library
672 (lambda* (#:key outputs #:allow-other-keys)
673 (delete-file (string-append (assoc-ref outputs "out")
677 `(("pkg-config" ,pkg-config)))
684 ("openblas" ,openblas)
687 "Toolkit for making machine learning and data analysis applications in C++")
689 "Dlib is a modern C++ toolkit containing machine learning algorithms and
690 tools. It is used in both industry and academia in a wide range of domains
691 including robotics, embedded devices, mobile phones, and large high performance
692 computing environments.")
693 (home-page "http://dlib.net")
694 (license license:boost1.0)))
696 (define-public python-scikit-learn
698 (name "python-scikit-learn")
704 "https://github.com/scikit-learn/scikit-learn/archive/"
706 (file-name (string-append name "-" version ".tar.gz"))
709 "18n8775kyfwbvcjjjzda9c5sqy4737c0hrmj6qj1ps2jmlqzair9"))
710 (patches (search-patches
711 "python-scikit-learn-fix-test-non-determinism.patch"))))
712 (build-system python-build-system)
715 (modify-phases %standard-phases
717 (add-after 'install 'check
718 ;; Running tests from the source directory requires
719 ;; an "inplace" build with paths relative to CWD.
720 ;; http://scikit-learn.org/stable/developers/advanced_installation.html#testing
721 ;; Use the installed version instead.
722 (lambda* (#:key inputs outputs #:allow-other-keys)
723 (add-installed-pythonpath inputs outputs)
724 ;; some tests require access to "$HOME"
725 (setenv "HOME" "/tmp")
726 ;; Step out of the source directory just to be sure.
728 (zero? (system* "nosetests" "-v" "sklearn")))))))
730 `(("openblas" ,openblas)))
732 `(("python-nose" ,python-nose)
733 ("python-cython" ,python-cython)))
735 `(("python-numpy" ,python-numpy)
736 ("python-scipy" ,python-scipy)))
737 (home-page "http://scikit-learn.org/")
738 (synopsis "Machine Learning in Python")
740 "Scikit-learn provides simple and efficient tools for data
741 mining and data analysis.")
742 (license license:bsd-3)))
744 (define-public python2-scikit-learn
745 (package-with-python2 python-scikit-learn))
747 (define-public python-autograd
748 (let* ((commit "442205dfefe407beffb33550846434baa90c4de7")
750 (version (git-version "0.0.0" revision commit)))
752 (name "python-autograd")
753 (home-page "https://github.com/HIPS/autograd")
761 "189sv2xb0mwnjawa9z7mrgdglc1miaq93pnck26r28fi1jdwg0z4"))
762 (file-name (git-file-name name version))))
764 (build-system python-build-system)
766 `(("python-nose" ,python-nose)
767 ("python-pytest" ,python-pytest)))
769 `(("python-future" ,python-future)
770 ("python-numpy" ,python-numpy)))
772 `(#:phases (modify-phases %standard-phases
775 (invoke "py.test" "-v"))))))
776 (synopsis "Efficiently computes derivatives of NumPy code")
777 (description "Autograd can automatically differentiate native Python and
778 NumPy code. It can handle a large subset of Python's features, including loops,
779 ifs, recursion and closures, and it can even take derivatives of derivatives
780 of derivatives. It supports reverse-mode differentiation
781 (a.k.a. backpropagation), which means it can efficiently take gradients of
782 scalar-valued functions with respect to array-valued arguments, as well as
783 forward-mode differentiation, and the two can be composed arbitrarily. The
784 main intended application of Autograd is gradient-based optimization.")
785 (license license:expat))))
787 (define-public python2-autograd
788 (package-with-python2 python-autograd))