jSDM package
Project description
s-jSDM - Fast and accurate Joint Species Distribution Modeling
About the method
The method is described in the preprint Pichler & Hartig (2020) A new method for faster and more accurate inference of species associations from novel community data, https://arxiv.org/abs/2003.05331. The code for producing the results in this paper is available under the subfolder publications in this repo.
The method itself is wrapped into an R package, available under subfolder sjSDM. You can also use it stand-alone under Python (see instructions below). Note: for both the R and the python package, python >= 3.6 and pytorch must be installed (more details below).
Install instructions
Dependencies:
- PyTorch >= 1.4, see PyTorch for install instructions.
pip install sjSDM_py
Example
import sjSDM_py as fa
import numpy as np
import torch
Env = np.random.randn(100, 5)
Occ = np.random.binomial(1, 0.5, [100, 10])
model = fa.Model_sjSDM(device=torch.device("cpu"), dtype=torch.float32)
model.add_env(5, 10)
model.build(5, optimizer=fa.optimizer_adamax(0.001),scheduler=False)
model.fit(Env, Occ, batch_size = 20, epochs = 100)
# print(model.weights)
# print(model.covariance)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sjSDM_py-0.0.3.tar.gz.
File metadata
- Download URL: sjSDM_py-0.0.3.tar.gz
- Upload date:
- Size: 17.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3.post20200330 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.6.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7cf137d90590d94ec5de5d4312f758b8fb80ed37a5036817d039546138f4f77a
|
|
| MD5 |
6f38231be486ac751a96731e55871203
|
|
| BLAKE2b-256 |
2791be51fbbc637ce0860f5c7436a1e2ef9089fcd11fb9829284ba36629c336f
|
File details
Details for the file sjSDM_py-0.0.3-py3-none-any.whl.
File metadata
- Download URL: sjSDM_py-0.0.3-py3-none-any.whl
- Upload date:
- Size: 46.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3.post20200330 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.6.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8fc9b256bb47f75d915341522e1d5eb77bf8e96992fbe31f9c820eb73408957b
|
|
| MD5 |
e8aa1f544c7827a8b13194cefd1c080d
|
|
| BLAKE2b-256 |
741e27eecfd68ca9097664879377977385c7276cb6ebea30747c14ca55152c61
|