{"id":16275562,"url":"https://github.com/andrie/tensorflowr","last_synced_at":"2025-07-19T03:32:54.515Z","repository":{"id":139001799,"uuid":"88326012","full_name":"andrie/tensorflowr","owner":"andrie","description":"Docker repository containing deep learning for R: RStudio, tensorflow and keras","archived":false,"fork":false,"pushed_at":"2017-06-19T16:20:54.000Z","size":10,"stargazers_count":7,"open_issues_count":1,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-08T16:53:42.825Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andrie.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-04-15T05:23:19.000Z","updated_at":"2023-09-02T15:24:38.000Z","dependencies_parsed_at":null,"dependency_job_id":"5839752f-db1e-473f-9a0b-559f39081fd8","html_url":"https://github.com/andrie/tensorflowr","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/andrie/tensorflowr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrie%2Ftensorflowr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrie%2Ftensorflowr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrie%2Ftensorflowr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrie%2Ftensorflowr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andrie","download_url":"https://codeload.github.com/andrie/tensorflowr/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrie%2Ftensorflowr/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265883675,"owners_count":23843792,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-10T18:35:25.055Z","updated_at":"2025-07-19T03:32:54.457Z","avatar_url":"https://github.com/andrie.png","language":null,"readme":"# tensorflowr: Docker repository with deep learning for R.\n\nimage            | description                               | from |size   | metrics | build status \n---------------- | ----------------------------------------- | ---- | ------ | ------- | --------------\n[reticulate](https://hub.docker.com/r/andrie/reticulate) |  R-3.3.3, RStudio, Python 3.4.2, Anaconda and the `reticulate` package | [rocker/rstudio:3.3.3](https://hub.docker.com/r/rocker/rstudio/) | [![](https://images.microbadger.com/badges/image/andrie/reticulate.svg)](https://microbadger.com/images/andrie/reticulate) | [![](https://img.shields.io/docker/pulls/andrie/reticulate.svg)](https://hub.docker.com/r/andrie/reticulate) |  [![](https://img.shields.io/docker/automated/andrie/reticulate.svg)](https://hub.docker.com/r/andrie/reticulate/builds)\n[tensorflowr](https://hub.docker.com/r/andrie/tensorflowr) | Adds tensorflow and keras, installed in python virtualenv and conda environment | [andrie/reticulate](https://hub.docker.com/r/andrie/reticulate) | [![](https://images.microbadger.com/badges/image/andrie/tensorflowr.svg)](https://microbadger.com/images/andrie/tensorflowr) | [![](https://img.shields.io/docker/pulls/andrie/tensorflowr.svg)](https://hub.docker.com/r/andrie/tensorflowr) |  [![](https://img.shields.io/docker/automated/andrie/tensorflowr.svg)](https://hub.docker.com/r/andrie/tensorflowr/builds)\n\n# Repositories\n\n## andrie/reticulate\n\nThis repository will be useful to test any R code that connects to Python using the `reticulate` package.  The repository uses [rocker/rstudio:3.3.3](https://hub.docker.com/r/rocker/rstudio/) as the base, and adds:\n\n* Python 3.4.2\n* Anaconda\n* R packages for:\n    - Typical development tools, including `devtools`, `roxygen2` and `rmarkdown`\n    - `Rcpp`\n    - `reticulate`, an interface layer between R and python, installed from [CRAN](https://cran.r-project.org/package=reticulate)\n\n\n## andrie/tensorflowr\n\nThis repository builds two environments that contain `tensorflow` ([tensorflow.org](https://www.tensorflow.org/)) and `keras` ([keras.io](https://keras.io/)):\n\n* Python virtual environment, containing:\n    - At location `/tensorflow`\n    - Python 3.4.2\n    - `tensorflow`, `keras` and `h5py`\n    - Activate this environment using\n        ```bash\n        source /tensorflow/bin/activate\n        ```\n    - A CRAN mirror pointing to a static MRAN snapshot of 2017-06-01\n\n* Anaconda environment ([conda env](https://conda.io/docs/using/envs.html)) containing:\n    - conda environment `tensorflow`\n    - Python 3.4.2\n    - `tensorflow`, `keras` and `h5py`\n    - Activate this environment using\n        ```bash\n        source activate tensorflow\n        ```\n* The R package `reticulate` (available on [CRAN](https://cran.r-project.org/web/packages/reticulate/index.html)) communicates between R and python.\n* The `reticulate` package needs to know where python is installed, so the repository writes environment variables into the `Renviron` file to configure `reticulate` correctly:\n\n    ```r\n    TENSORFLOW_PYTHON = \"/tensorflow/bin/python\"\n    RETICULATE_PYTHON = \"/tensorflow/bin/python\"\n    ```\n\n# Docker instructions\n\n## Pull\n\nTo pull and build the image, use:\n\n```\ndocker pull andrie/tensorflowr\n```\n\n## Run\n\nSince the repository contains `rocker/rstudio`, you can run RStudio in your web browser by pointing to [https://localhost:8787]([https://localhost:8787) if you map the ports. The following line creates a container and names it `tensorflowr`, so you can easily refer to this later.\n\n```\ndocker run -d --name tensorflowr -p 8787:8787 andrie/tensorflowr\n```\n\n## Exec\n\nTo execute code inside the running container:\n\n```\ndocker exec -ti tensorflowr bash\n```\n\n# Hello world\n\n## tensorflow\n\nTo test `tensorflow`, try the `Hallo world` example from the `tensorflow` R package:\n\n```r\nlibrary(tensorflow)\nsess = tf$Session()\nhello \u003c- tf$constant('Hello, TensorFlow!')\nsess$run(hello)\n```\n\n## keras\n\nTo test `keras`, try the code from the `kerasR` [vignette](https://cran.r-project.org/web/packages/kerasR/vignettes/introduction.html):\n\n```r\nlibrary(kerasR)\nmod \u003c- Sequential()\nmod$add(Dense(units = 50, input_shape = 13))\nmod$add(Activation(\"relu\"))\nmod$add(Dense(units = 1))\nkeras_compile(mod,  loss = 'mse', optimizer = RMSprop())\nboston \u003c- load_boston_housing()\nX_train \u003c- scale(boston$X_train)\nY_train \u003c- boston$Y_train\nX_test \u003c- scale(boston$X_test)\nY_test \u003c- boston$Y_test\nkeras_fit(mod, X_train, Y_train,\n          batch_size = 32, epochs = 200,\n          verbose = 1, validation_split = 0.1)\npred \u003c- keras_predict(mod, normalize(X_test))\nsd(as.numeric(pred) - Y_test) / sd(Y_test)\n```\n\n# License\n\n© Andrie de Vries\n\n [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrie%2Ftensorflowr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandrie%2Ftensorflowr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrie%2Ftensorflowr/lists"}