From ab7314cd7b7ae5856de3834782d38c3ddd71fe31 Mon Sep 17 00:00:00 2001 From: Francois Berenger Date: Tue, 14 Feb 2023 10:58:56 +0900 Subject: [PATCH 1/2] new file: packages/odnnr/odnnr.2.0.3/opam --- packages/odnnr/odnnr.2.0.3/opam | 46 +++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 packages/odnnr/odnnr.2.0.3/opam diff --git a/packages/odnnr/odnnr.2.0.3/opam b/packages/odnnr/odnnr.2.0.3/opam new file mode 100644 index 00000000000..8fdf0d07dfe --- /dev/null +++ b/packages/odnnr/odnnr.2.0.3/opam @@ -0,0 +1,46 @@ +opam-version: "2.0" +maintainer: "unixjunkie@sdf.org" +authors: ["Francois Berenger"] +homepage: "https://github.com/UnixJunkie/odnnr" +bug-reports: "https://github.com/UnixJunkie/odnnr/issues" +dev-repo: "git+https://github.com/UnixJunkie/odnnr.git" +license: "LGPL-2.1-only WITH OCaml-LGPL-linking-exception" +install: ["R" "CMD" "BATCH" "install_keras.r"] +build: ["dune" "build" "-p" name "-j" jobs] +depends: [ + "ocaml" + "conf-r" + "dune" {>= "1.11.0"} + "dolog" {>= "4.0.0"} + "batteries" + "minicli" {>= "5.0.0"} + "parany" {>= "11.0.2"} + "cpm" + "conf-gnuplot" +] +x-ci-accept-failures: ["debian-unstable"] +synopsis: "Regressor using a Deep Neural Network" +description: """ +Some OCaml functions to drive the Deep Learning R 'keras' package; +but only for training a regressor using a multi-layer perceptron. +This package really fires up and talks to an R interpreter. + +Bibliography: +============= +Deep Learning with R. François Chollet with J. J. Allaire. +January 2018, ISBN 9781617295546. +""" +post-messages: + """ +Please interact with pip3 then R to install required dependencies in user-space: +pip3 install tensorflow keras +R +install.packages('keras', repos='http://cran.r-project.org') +library(keras)""" {failure} +extra-files: [ + ["install_keras.r" "md5=ad1bb71c78db06e7a38b24ec6b34273d"] +] +url { + src: "https://github.com/UnixJunkie/odnnr/archive/v2.0.3.tar.gz" + checksum: "md5=aa79807cfd13aeb93e5af74215856b78" +} From 6b62b33f94fa0d7f64aa4da5cb0c75e78fa3b3ee Mon Sep 17 00:00:00 2001 From: Francois Berenger Date: Tue, 21 Feb 2023 09:54:38 +0900 Subject: [PATCH 2/2] new file: packages/odnnr/odnnr.2.0.3/files/install_keras.r --- packages/odnnr/odnnr.2.0.3/files/install_keras.r | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 packages/odnnr/odnnr.2.0.3/files/install_keras.r diff --git a/packages/odnnr/odnnr.2.0.3/files/install_keras.r b/packages/odnnr/odnnr.2.0.3/files/install_keras.r new file mode 100644 index 00000000000..925090dccc7 --- /dev/null +++ b/packages/odnnr/odnnr.2.0.3/files/install_keras.r @@ -0,0 +1,8 @@ +# for keras and tensorflow, let's assume the user has installed them in +# user-space as a prerequisite using 'pip3 install tensorflow keras' +# here, we just test that the keras library can be loaded in R +pkg <- 'keras' +if (!require(pkg, character.only = TRUE)) { + install.packages(pkg, dependencies = TRUE, repos='http://cran.r-project.org') +} +library(keras)