https://github.com/andrewzm/deepspat

Deep Compositional Spatial Models

https://github.com/andrewzm/deepspat

Science Score: 39.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 3 DOI reference(s) in README
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.1%) to scientific vocabulary
Last synced: 10 months ago · JSON representation

Repository

Deep Compositional Spatial Models

Basic Info
  • Host: GitHub
  • Owner: andrewzm
  • Language: R
  • Default Branch: master
  • Size: 413 KB
Statistics
  • Stars: 9
  • Watchers: 2
  • Forks: 2
  • Open Issues: 2
  • Releases: 3
Created over 7 years ago · Last pushed 10 months ago
Metadata Files
Readme

README.md

Deep Compositional Spatial Models

Note: This version uses TensorFlowv2 -- for the original TensorFlowv1 version please download Release 0.2.0

Deep compositional spatial models are standard spatial covariance models coupled with an injective warping function of the spatial domain. The warping function is constructed through a composition of multiple elemental injective functions in a deep-learning framework. The package implements two cases for the univariate setting; first, when these warping functions are known up to some weights that need to be estimated, and, second, when the weights in each layer are random. In the multivariate setting only the former case is available. Estimation and inference is done using TensorFlow, which makes use of graphics processing units.

drawing

Resources

A manuscript detailing the theory and implementation in the univariate setting is available here, while a manuscript detailng the theory and implementation in a multivariate setting is available here. An informal blog post summarising the manuscript concerning the univariate setting is available here.

Installation Instructions

This is an R package. Please install devtools and then install this package by typing library("devtools") install_github("andrewzm/deepspat") in an R console.

Reproducible Code

Code using this package for reproducing the results shown in the manuscript describing the univariate setting is available in the supplemental material of our first article. Code for the results shown in manuscript describing the multivariate setting is available here. Please note that for this version of deepspat yyou will require R 3.6, TensorFlow 2.x and Python 3.7.10.

``` R version 3.6.3 (2020-02-29) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Ubuntu 20.04.3 LTS

Matrix products: default BLAS: /usr/lib/x8664-linux-gnu/openblas-pthread/libblas.so.3 LAPACK: /usr/lib/x8664-linux-gnu/openblas-pthread/liblapack.so.3

locale: [1] LCCTYPE=enAU.UTF-8 LCNUMERIC=C
[3] LC
TIME=enAU.UTF-8 LCCOLLATE=enAU.UTF-8
[5] LC
MONETARY=enAU.UTF-8 LCMESSAGES=enAU.UTF-8
[7] LC
PAPER=enAU.UTF-8 LCNAME=C
[9] LCADDRESS=C LCTELEPHONE=C
[11] LCMEASUREMENT=enAU.UTF-8 LC_IDENTIFICATION=C

attached base packages: [1] stats graphics grDevices utils datasets methods base

other attached packages: [1] dplyr1.0.5 deepspat0.1.2 deepGP0.1.0 testthat3.0.2 [5] jsonlite1.7.2 ggplot23.3.3 devtools2.4.0 usethis2.0.1
[9] reticulate_1.18

loaded via a namespace (and not attached): [1] fs1.5.0 xts0.12.1 FRK2.0.3
[4] RColorBrewer
1.1-2 rprojroot2.0.2 tools3.6.3
[7] TMB1.7.20 backports1.2.1 utf81.2.1
[10] R6
2.5.0 rpart4.1-15 Hmisc4.5-0
[13] colorspace2.0-0 nnet7.3-13 withr2.4.2
[16] sp
1.4-5 tidyselect1.1.0 gridExtra2.3
[19] prettyunits1.1.1 processx3.5.0 curl4.3
[22] compiler
3.6.3 cli2.4.0 htmlTable2.1.0
[25] desc1.3.0 sparseinv0.1.3 scales1.1.1
[28] checkmate
2.0.0 callr3.6.0 rappdirs0.3.3
[31] tfruns1.5.0 stringr1.4.0 digest0.6.27
[34] foreign
0.8-75 rio0.5.26 base64enc0.1-3
[37] jpeg0.1-8.1 pkgconfig2.0.3 htmltools0.5.1.1
[40] sessioninfo
1.1.1 fastmap1.1.0 readxl1.3.1
[43] htmlwidgets1.5.3 rlang0.4.10 rstudioapi0.13
[46] generics
0.1.0 zoo1.8-9 tensorflow2.4.0
[49] zip2.1.1 car3.0-10 magrittr2.0.1
[52] Formula
1.2-4 dotCall641.0-1 Matrix1.2-18
[55] Rcpp1.0.6 munsell0.5.0 fansi0.4.2
[58] abind
1.4-5 lifecycle1.0.0 whisker0.4
[61] stringi1.5.3 carData3.0-4 plyr1.8.6
[64] pkgbuild
1.2.0 grid3.6.3 parallel3.6.3
[67] forcats0.5.1 crayon1.4.1 lattice0.20-40
[70] haven
2.4.1 splines3.6.3 hms1.0.0
[73] knitr1.33 ps1.6.0 pillar1.6.0
[76] ggpubr
0.4.0 spacetime1.2-4 ggsignif0.6.1
[79] reshape21.4.4 pkgload1.2.1 glue1.4.2
[82] latticeExtra
0.6-29 data.table1.14.2 remotes2.3.0
[85] png0.1-7 vctrs0.3.7 spam2.6-0
[88] cellranger
1.1.0 gtable0.3.0 purrr0.3.4
[91] tidyr1.1.3 cachem1.0.4 xfun0.22
[94] openxlsx
4.2.3 broom0.7.6 rstatix0.7.0
[97] survival3.1-8 tibble3.1.1 intervals0.15.2
[100] memoise
2.0.0 cluster2.1.0 statmod1.4.35
[103] ellipsis_0.3.1
```

Note that when running within conda you will need to preface the R scripts with

library("reticulate")
use_condaenv("~/miniconda3/envs/TFv2/")

where you'd need to use your specific conda environment path.

I did not retain the exact original environment I used to produce the results but this environment should work. It was brought to my attention though that the DGPsparse code was not converging for the Monterrubio example with this environment. It does converge if you decrease the learning rates in the deepGP() function by a factor of ten in Experiment1D_DGPsparse.R:

learnrates = list(MH = 1e-7, SH = 1e-4, Z = 1e-9,
                  pars = par_learn_rate)

I also suggest fixing the seed in this script, so adding in the for loop of Experiment1D_DGPsparse.R:

set.seed(1)
tf$set_random_seed(1)
tf$random$set_random_seed(1)

Owner

  • Name: Andrew Zammit Mangion
  • Login: andrewzm
  • Kind: user
  • Location: Wollongong, Australia
  • Company: University of Wollongong

GitHub Events

Total
  • Watch event: 1
  • Delete event: 1
  • Push event: 35
  • Pull request review event: 2
  • Pull request event: 6
  • Fork event: 1
  • Create event: 1
Last Year
  • Watch event: 1
  • Delete event: 1
  • Push event: 35
  • Pull request review event: 2
  • Pull request event: 6
  • Fork event: 1
  • Create event: 1

Dependencies

DESCRIPTION cran
  • Matrix * imports
  • data.table * imports
  • dplyr * imports
  • methods * imports
  • reticulate * imports
  • tensorflow * imports