gnu: sbcl-trivial-clipboard: Update to 20200904.
[jackhill/guix/guix.git] / gnu / packages / machine-learning.scm
index 0c02fbc..89345fa 100644 (file)
@@ -15,6 +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 Vinicius Monego <monego@posteo.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -37,7 +38,6 @@
   #:use-module (guix utils)
   #:use-module (guix download)
   #:use-module (guix svn-download)
-  #:use-module (guix build-system asdf)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system ocaml)
@@ -54,6 +54,7 @@
   #:use-module (gnu packages boost)
   #:use-module (gnu packages check)
   #:use-module (gnu packages compression)
+  #:use-module (gnu packages cmake)
   #:use-module (gnu packages cran)
   #:use-module (gnu packages databases)
   #:use-module (gnu packages dejagnu)
@@ -63,7 +64,6 @@
   #:use-module (gnu packages gstreamer)
   #:use-module (gnu packages image)
   #:use-module (gnu packages linux)
-  #:use-module (gnu packages lisp-xyz)
   #:use-module (gnu packages maths)
   #:use-module (gnu packages mpi)
   #:use-module (gnu packages ocaml)
@@ -72,6 +72,7 @@
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages protobuf)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages python-check)
   #:use-module (gnu packages python-science)
   #:use-module (gnu packages python-web)
   #:use-module (gnu packages python-xyz)
@@ -95,7 +96,7 @@
       (source (origin
                 (method git-fetch)
                 (uri (git-reference
-                      (url "https://github.com/libfann/fann.git")
+                      (url "https://github.com/libfann/fann")
                       (commit commit)))
                 (file-name (string-append name "-" version "-checkout"))
                 (sha256
@@ -317,7 +318,7 @@ networks) based on simulation of (stochastic) flow in graphs.")
      (origin
        (method git-fetch)
        (uri (git-reference
-             (url "https://github.com/fhcrc/mcl.git")
+             (url "https://github.com/fhcrc/mcl")
              (commit version)))
        (file-name (git-file-name name version))
        (sha256
@@ -414,14 +415,14 @@ sample proximities between pairs of cases.")
 (define-public openfst
   (package
     (name "openfst")
-    (version "1.7.2")
+    (version "1.7.9")
     (source (origin
               (method url-fetch)
               (uri (string-append "http://www.openfst.org/twiki/pub/FST/"
                                   "FstDownload/openfst-" version ".tar.gz"))
               (sha256
                (base32
-                "0fqgk8195kz21is09gwzwnrg7fr9526bi9mh4apyskapz27pbhr1"))))
+                "1pmx1yhn2gknj0an0zwqmzgwjaycapi896244np50a8y3nrsw6ck"))))
     (build-system gnu-build-system)
     (home-page "http://www.openfst.org")
     (synopsis "Library for weighted finite-state transducers")
@@ -578,6 +579,46 @@ tools.  This enables both rapid prototyping of data pipelines and extensibility
 in terms of new algorithms.")
     (license license:gpl3+)))
 
+(define-public python-onnx
+  (package
+    (name "python-onnx")
+    (version "1.7.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "onnx" version))
+       ;; ONNX will build googletest from a git checkout.  Patch CMake
+       ;; to use googletest from Guix and enable tests by default.
+       (patches (search-patches "python-onnx-use-system-googletest.patch"))
+       (sha256
+        (base32 "0j6rgfbhsw3a8id8pyg18y93k68lbjbj1kq6qia36h69f6pvlyjy"))))
+    (build-system python-build-system)
+    (native-inputs
+     `(("cmake" ,cmake)
+       ("googletest" ,googletest)
+       ("pybind11" ,pybind11)
+       ("python-coverage" ,python-coverage)
+       ("python-nbval" ,python-nbval)
+       ("python-pytest" ,python-pytest)
+       ("python-pytest-runner" ,python-pytest-runner)))
+    (inputs
+     `(("protobuf" ,protobuf)))
+    (propagated-inputs
+     `(("python-numpy" ,python-numpy)
+       ("python-protobuf" ,python-protobuf)
+       ("python-six" ,python-six)
+       ("python-tabulate" ,python-tabulate)
+       ("python-typing-extensions"
+        ,python-typing-extensions)))
+    (home-page "https://onnx.ai/")
+    (synopsis "Open Neural Network Exchange")
+    (description
+     "Open Neural Network Exchange (ONNX) provides an open source format for
+AI models, both deep learning and traditional ML.  It defines an extensible
+computation graph model, as well as definitions of built-in operators and
+standard data types.")
+    (license license:expat)))
+
 (define-public rxcpp
   (package
     (name "rxcpp")
@@ -586,7 +627,7 @@ in terms of new algorithms.")
      (origin
        (method git-fetch)
        (uri (git-reference
-             (url "https://github.com/ReactiveX/RxCpp.git")
+             (url "https://github.com/ReactiveX/RxCpp")
              (commit (string-append "v" version))))
        (sha256
         (base32 "1rdpa3jlc181jd08nk437aar085h28i45s6nzrv65apb3xyyz0ij"))
@@ -619,42 +660,6 @@ synchronization, thread-safety, concurrent data structures, and non-blocking
 I/O.")
     (license license:asl2.0)))
 
-(define-public r-adaptivesparsity
-  (package
-    (name "r-adaptivesparsity")
-    (version "1.6")
-    (source (origin
-              (method url-fetch)
-              (uri (cran-uri "AdaptiveSparsity" version))
-              (sha256
-               (base32
-                "0imr5m8mll9j6n4icsv6z9rl5kbnwsp9wvzrg7n90nnmcxq2cz91"))))
-    (properties
-     `((upstream-name . "AdaptiveSparsity")))
-    (build-system r-build-system)
-    (arguments
-     `(#:phases
-       (modify-phases %standard-phases
-         (add-after 'unpack 'link-against-armadillo
-           (lambda _
-             (substitute* "src/Makevars"
-               (("PKG_LIBS=" prefix)
-                (string-append prefix "-larmadillo"))))))))
-    (propagated-inputs
-     `(("r-mass" ,r-mass)
-       ("r-matrix" ,r-matrix)
-       ("r-rcpp" ,r-rcpp)
-       ("r-rcpparmadillo" ,r-rcpparmadillo)))
-    (inputs
-     `(("armadillo" ,armadillo)))
-    (home-page "https://cran.r-project.org/web/packages/AdaptiveSparsity")
-    (synopsis "Adaptive sparsity models")
-    (description
-     "This package implements the Figueiredo machine learning algorithm for
-adaptive sparsity and the Wong algorithm for adaptively sparse gaussian
-geometric models.")
-    (license license:lgpl3+)))
-
 (define-public gemmlowp-for-tensorflow
   ;; The commit hash is taken from "tensorflow/workspace.bzl".
   (let ((commit "38ebac7b059e84692f53e5938f97a9943c120d98")
@@ -732,7 +737,8 @@ than 8 bits, and at the end only some significant 8 bits are kept.")
                   #t))))
     (build-system cmake-build-system)
     (arguments
-     `(#:phases
+     `(#:configure-flags '("-DBUILD_SHARED_LIBS=ON")
+       #:phases
        (modify-phases %standard-phases
          (add-after 'unpack 'disable-asserts
            (lambda _
@@ -769,12 +775,7 @@ than 8 bits, and at the end only some significant 8 bits are kept.")
                (with-directory-excursion test-dir
                  (invoke "make" "-j" (number->string (parallel-job-count)))
                  (invoke "./dtest" "--runall"))
-               #t)))
-         (add-after 'install 'delete-static-library
-           (lambda* (#:key outputs #:allow-other-keys)
-             (delete-file (string-append (assoc-ref outputs "out")
-                                         "/lib/libdlib.a"))
-             #t)))))
+               #t))))))
     (native-inputs
      `(("pkg-config" ,pkg-config)
        ;; For tests.
@@ -805,7 +806,7 @@ computing environments.")
      (origin
        (method git-fetch)
        (uri (git-reference
-             (url "https://github.com/scikit-learn/scikit-learn.git")
+             (url "https://github.com/scikit-learn/scikit-learn")
              (commit version)))
        (file-name (git-file-name name version))
        (sha256
@@ -862,7 +863,7 @@ data analysis.")
       (source (origin
                 (method git-fetch)
                 (uri (git-reference
-                      (url "https://github.com/scikit-learn/scikit-learn.git")
+                      (url "https://github.com/scikit-learn/scikit-learn")
                       (commit version)))
                 (file-name (git-file-name "python-scikit-learn" version))
                 (sha256
@@ -1012,7 +1013,16 @@ the following advantages:
        (modify-phases %standard-phases
          (add-after 'unpack 'make-files-writable
            (lambda _
-             (for-each make-file-writable (find-files "." ".*")) #t)))))
+             (for-each make-file-writable (find-files "." ".*")) #t))
+         (add-after 'install 'install-more-headers
+           (lambda* (#:key outputs #:allow-other-keys)
+             (for-each
+               (lambda (file)
+                 (install-file file (string-append
+                                      (assoc-ref outputs "out")
+                                      "/include/vowpalwabbit")))
+               (find-files "vowpalwabbit" "\\.h$"))
+             #t)))))
     (build-system gnu-build-system)
     (home-page "https://github.com/JohnLangford/vowpal_wabbit")
     (synopsis "Fast machine learning library for online learning")
@@ -1066,7 +1076,7 @@ association studies (GWAS) on extremely large data sets.")
       (source (origin
                 (method git-fetch)
                 (uri (git-reference
-                      (url "https://github.com/kaldi-asr/kaldi.git")
+                      (url "https://github.com/kaldi-asr/kaldi")
                       (commit commit)))
                 (file-name (git-file-name name version))
                 (sha256
@@ -1177,7 +1187,7 @@ written in C++.")
       (source (origin
                 (method git-fetch)
                 (uri (git-reference
-                      (url "https://github.com/alumae/gst-kaldi-nnet2-online.git")
+                      (url "https://github.com/alumae/gst-kaldi-nnet2-online")
                       (commit commit)))
                 (file-name (git-file-name name version))
                 (sha256
@@ -1249,7 +1259,7 @@ automatically.")
       (source (origin
                 (method git-fetch)
                 (uri (git-reference
-                      (url "https://github.com/alumae/kaldi-gstreamer-server.git")
+                      (url "https://github.com/alumae/kaldi-gstreamer-server")
                       (commit commit)))
                 (file-name (git-file-name name version))
                 (sha256
@@ -1353,7 +1363,7 @@ Python.")
      (origin
        (method git-fetch)
        (uri (git-reference
-             (url "https://github.com/tensorflow/tensorflow.git")
+             (url "https://github.com/tensorflow/tensorflow")
              (commit (string-append "v" version))))
        (file-name (string-append "tensorflow-" version "-checkout"))
        (sha256
@@ -1683,7 +1693,7 @@ INSTALL_RPATH " (assoc-ref outputs "out") "/lib)\n")))
            (origin
              (method git-fetch)
              (uri (git-reference
-                   (url "https://github.com/google/double-conversion.git")
+                   (url "https://github.com/google/double-conversion")
                    (commit commit)))
              (file-name
               (git-file-name "double-conversion"
@@ -1728,7 +1738,7 @@ INSTALL_RPATH " (assoc-ref outputs "out") "/lib)\n")))
            (origin
              (method git-fetch)
              (uri (git-reference
-                   (url "https://github.com/google/highwayhash.git")
+                   (url "https://github.com/google/highwayhash")
                    (commit commit)))
              (file-name (string-append "highwayhash-0-" revision
                                        (string-take commit 7)
@@ -1965,122 +1975,6 @@ that:
 @end itemize\n")
     (license license:expat)))
 
-(define-public sbcl-cl-libsvm-format
-  (let ((commit "3300f84fd8d9f5beafc114f543f9d83417c742fb")
-        (revision "0"))
-    (package
-      (name "sbcl-cl-libsvm-format")
-      (version (git-version "0.1.0" revision commit))
-      (source
-       (origin
-         (method git-fetch)
-         (uri (git-reference
-               (url "https://github.com/masatoi/cl-libsvm-format.git")
-               (commit commit)))
-         (file-name (git-file-name name version))
-         (sha256
-          (base32
-           "0284aj84xszhkhlivaigf9qj855fxad3mzmv3zfr0qzb5k0nzwrg"))))
-      (build-system asdf-build-system/sbcl)
-      (native-inputs
-       `(("prove" ,sbcl-prove)
-         ("prove-asdf" ,sbcl-prove-asdf)))
-      (inputs
-       `(("alexandria" ,sbcl-alexandria)))
-      (synopsis "LibSVM data format reader for Common Lisp")
-      (description
-       "This Common Lisp library provides a fast reader for data in LibSVM
-format.")
-      (home-page "https://github.com/masatoi/cl-libsvm-format")
-      (license license:expat))))
-
-(define-public cl-libsvm-format
-  (sbcl-package->cl-source-package sbcl-cl-libsvm-format))
-
-(define-public ecl-cl-libsvm-format
-  (sbcl-package->ecl-package sbcl-cl-libsvm-format))
-
-(define-public sbcl-cl-online-learning
-  (let ((commit "fc7a34f4f161cd1c7dd747d2ed8f698947781423")
-        (revision "0"))
-    (package
-      (name "sbcl-cl-online-learning")
-      (version (git-version "0.5" revision commit))
-      (source
-       (origin
-         (method git-fetch)
-         (uri (git-reference
-               (url "https://github.com/masatoi/cl-online-learning.git")
-               (commit commit)))
-         (file-name (git-file-name name version))
-         (sha256
-          (base32
-           "14x95rlg80ay5hv645ki57pqvy12v28hz4k1w0f6bsfi2rmpxchq"))))
-      (build-system asdf-build-system/sbcl)
-      (native-inputs
-       `(("prove" ,sbcl-prove)
-         ("prove-asdf" ,sbcl-prove-asdf)))
-      (inputs
-       `(("cl-libsvm-format" ,sbcl-cl-libsvm-format)
-         ("cl-store" ,sbcl-cl-store)))
-      (arguments
-       `(;; FIXME: Tests pass but then the check phase crashes
-         #:tests? #f))
-      (synopsis "Online Machine Learning for Common Lisp")
-      (description
-       "This library contains a collection of machine learning algorithms for
-online linear classification written in Common Lisp.")
-      (home-page "https://github.com/masatoi/cl-online-learning")
-      (license license:expat))))
-
-(define-public cl-online-learning
-  (sbcl-package->cl-source-package sbcl-cl-online-learning))
-
-(define-public ecl-cl-online-learning
-  (sbcl-package->ecl-package sbcl-cl-online-learning))
-
-(define-public sbcl-cl-random-forest
-  (let ((commit "85fbdd4596d40e824f70f1b7cf239cf544e49d51")
-        (revision "0"))
-    (package
-      (name "sbcl-cl-random-forest")
-      (version (git-version "0.1" revision commit))
-      (source
-       (origin
-         (method git-fetch)
-         (uri (git-reference
-               (url "https://github.com/masatoi/cl-random-forest.git")
-               (commit commit)))
-         (file-name (git-file-name name version))
-         (sha256
-          (base32
-           "097xv60i1ndz68sg9p4pc7c5gvyp9i1xgw966b4wwfq3x6hbz421"))))
-      (build-system asdf-build-system/sbcl)
-      (native-inputs
-       `(("prove" ,sbcl-prove)
-         ("prove-asdf" ,sbcl-prove-asdf)
-         ("trivial-garbage" ,sbcl-trivial-garbage)))
-      (inputs
-       `(("alexandria" ,sbcl-alexandria)
-         ("cl-libsvm-format" ,sbcl-cl-libsvm-format)
-         ("cl-online-learning" ,sbcl-cl-online-learning)
-         ("lparallel" ,sbcl-lparallel)))
-      (arguments
-       `(#:tests? #f)) ; The tests download data from the Internet
-      (synopsis "Random Forest and Global Refinement for Common Lisp")
-      (description
-       "CL-random-forest is an implementation of Random Forest for multiclass
-classification and univariate regression written in Common Lisp.  It also
-includes an implementation of Global Refinement of Random Forest.")
-      (home-page "https://github.com/masatoi/cl-random-forest")
-      (license license:expat))))
-
-(define-public cl-random-forest
-  (sbcl-package->cl-source-package sbcl-cl-random-forest))
-
-(define-public ecl-cl-random-forest
-  (sbcl-package->ecl-package sbcl-cl-random-forest))
-
 (define-public gloo
   (let ((version "0.0.0") ; no proper version tag
         (commit "ca528e32fea9ca8f2b16053cff17160290fc84ce")
@@ -2092,7 +1986,7 @@ includes an implementation of Global Refinement of Random Forest.")
        (origin
          (method git-fetch)
          (uri (git-reference
-               (url "https://github.com/facebookincubator/gloo.git")
+               (url "https://github.com/facebookincubator/gloo")
                (commit commit)))
          (file-name (git-file-name name version))
          (sha256