Giter Site home page Giter Site logo

keichi / kedm Goto Github PK

View Code? Open in Web Editor NEW
12.0 4.0 5.0 562 KB

A high-performance implementation of Empirical Dynamic Modeling (EDM)

Home Page: https://kedm.readthedocs.io/

License: MIT License

CMake 2.94% C++ 45.59% Python 51.33% Shell 0.14%
high-performance-computing empirical-dynamic-modeling nonlinear-dynamics time-series

kedm's Introduction

kEDM

build Documentation Status PyPI version

kEDM (Kokkos-EDM) is a high-performance implementation of the Empirical Dynamical Modeling (EDM) framework. The goal of kEDM is to provide an optimized and parallelized implementation of EDM algorithms for high-end CPUs and GPUs, while ensuring compatibility with the original reference implementation (cppEDM).

Following EDM algorithms are currently implemented in kEDM:

  • Simplex projection [1]
  • Sequential Locally Weighted Global Linear Maps (S-Map) [2]
  • Convergent Cross Mapping (CCM) [3]

Installation

CPU (Linux and macOS)

pip3 install kedm

NVIDIA GPU (CUDA 11.2 or later)

pip3 install kedm-11x

NVIDIA GPU (CUDA 12.0 or later)

pip3 install kedm-12x

Citing

Please cite the following papers if you find kEDM useful:

  • Keichi Takahashi, Kohei Ichikawa, Joseph Park, Gerald M. Pao, “Scalable Empirical Dynamic Modeling with Parallel Computing and Approximate k-NN Search,” IEEE Access, vol. 11, pp. 68171–68183, Jun. 2023. 10.1109/ACCESS.2023.3289836
  • Keichi Takahashi, Wassapon Watanakeesuntorn, Kohei Ichikawa, Joseph Park, Ryousei Takano, Jason Haga, George Sugihara, Gerald M. Pao, "kEDM: A Performance-portable Implementation of Empirical Dynamical Modeling," Practice & Experience in Advanced Research Computing (PEARC 2021), Jul. 2021. 10.1145/3437359.3465571

References

  1. George Sugihara, Robert May, "Nonlinear forecasting as a way of distinguishing chaos from measurement error in time series," Nature, vol. 344, pp. 734–741, 1990. 10.1038/344734a0
  2. George Sugihara, "Nonlinear forecasting for the classification of natural time series. Philosophical Transactions," Physical Sciences and Engineering, vol. 348, no. 1688, pp. 477–495, 1994. 10.1098/rsta.1994.0106
  3. George Sugihara, Robert May, Hao Ye, Chih-hao Hsieh, Ethan Deyle, Michael Fogarty, Stephan Munch, "Detecting Causality in Complex Ecosystems," Science, vol. 338, pp. 496–500, 2012. 10.1126/science.1227079

kedm's People

Contributors

keichi avatar softwareliteracy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

kedm's Issues

xmap issue

Hello @keichi ,

I passed a 2D numpy array to the xmap function as below.

import kedm
import numpy as np

x = np.random.uniform(2,15,size=6000).astype('float32')
y = np.random.uniform(2,15,size=6000).astype('float32')
data = np.stack((x,y),axis=1)
print(data.shape)
ccm = kedm.xmap(data)

I am getting a type error for this as shown below. Am I missing anything here? Thanks in advance

image

`kedm.__version__` is invalid

kedm.__version__ is invalid when installed from PyPI. Probably because #12 removed versionfile_build.

keichi@m1max tmp % pip3 install kedm==0.5.0
Collecting kedm==0.5.0
  Using cached kedm-0.5.0-cp311-cp311-macosx_11_0_arm64.whl (806 kB)
Collecting numpy>=1.7.0
  Using cached numpy-1.24.2-cp311-cp311-macosx_11_0_arm64.whl (13.8 MB)
Installing collected packages: numpy, kedm
Successfully installed kedm-0.5.0 numpy-1.24.2

[notice] A new release of pip available: 22.3.1 -> 23.0.1
[notice] To update, run: pip install --upgrade pip
keichi@m1max tmp % python3 -c 'import kedm; print(kedm.__version__)'
Kokkos::OpenMP::initialize WARNING: OMP_PROC_BIND environment variable not set
  In general, for best performance with OpenMP 4.0 or better set OMP_PROC_BIND=spread and OMP_PLACES=threads
  For best performance with OpenMP 3.1 set OMP_PROC_BIND=true
  For unit testing set OMP_PROC_BIND=false

0+unknown

edm-xmap crash

I'm trying to utilize the edm-xmap executable for a simulated rossler attractor connected to a downstream RNN. I get the following "core dumped" error. Any ideas?

 (kedm2) david.wyrick@robinson:~/Git/kEDM/build$ ./edm-xmap --rho --rho-diff -v rossler_attractor_data.h5 test.h5
Simpelx for time series #0 took 0.433066 seconds.
Simpelx for time series #1 took 0.727102 seconds.
Simpelx for time series #2 took 0.718243 seconds.
Simpelx for time series #3 took 0.729723 seconds.
Simpelx for time series #4 took 0.712222 seconds.
Simpelx for time series #5 took 0.70494 seconds.
Simpelx for time series #6 took 0.715175 seconds.
Simpelx for time series #7 took 0.715711 seconds.
Simpelx for time series #8 took 0.707749 seconds.
Simpelx for time series #9 took 0.712507 seconds.
49152 260024
Aborted (core dumped)

return smap coefficients

Please consider to return the matrix of smap coefficients. They are a primary tool used to asses intravariable interactions.

Difference between edm-xmap executable and Python binding xmap

@keichi , I'm trying to understand the difference between the edm-xmap executable and the python binding xmap. Are they different? In the documentation, it says the executable performs pairwise cross mapping using simplex projection. What does the python binding xmap do? Furthermore, how are the xmap and ccm python functions different? Are the random samples drawn in the CCM function excluded from the embedding procedure?

A follow up question is why the python bindings run slower than the executable. Both appear to be using the GPU, but the executable calculates the all-to-all CCM for a 10,000 x 500 matrix in like 20 seconds whereas the python code takes forever (i didn't finish it). it's almost as if the python binding is only partially utilizing the GPU.

Originally posted by @davidgwyrick in #40 (comment)

error while installing using CMake

Hello, I seem to be getting a compile error during installation related to Cuda. My workstation has a GeForce RTX 4090 with cuda 12.1 installed. I first created a conda environment, which I installed the cuda toolbox. It fails to find the correct nvidia GPU architecture even though I specified the correct one (I think). any ideas? Thank you in advance.

(kedm) david.wyrick@robinson:~/Git/kEDM$ cmake -B build -S . -DKEDM_ENABLE_PYTHON=ON -DKEDM_ENABLE_GPU=ON -DKokkos_ARCH_ADA89=ON -DKEDM_ENABLE_EXECUTABLES=ON
-- Setting default Kokkos CXX standard to 17
-- The project name is: Kokkos
-- Using internal gtest for testing
-- Compiler Version: 12.2.128
-- kokkos_launch_compiler (/home/david.wyrick/Git/kEDM/src/thirdparty/kokkos/bin/kokkos_launch_compiler) is enabled...
-- Using -std=c++17 for C++17 standard as feature
-- CUDA auto-detection of architecture failed with /usr/bin/c++. Enabling CUDA language ONLY to auto-detect architecture...
CMake Error at src/thirdparty/kokkos/cmake/kokkos_arch.cmake:801 (MESSAGE):
CUDA enabled but no NVIDIA GPU architecture currently enabled and
auto-detection failed. Please give one -DKokkos_ARCH_{..}=ON' to enable an
NVIDIA GPU architecture.

You can yourself try to compile
/home/david.wyrick/Git/kEDM/src/thirdparty/kokkos/cmake/compile_tests/cuda_compute_capability.cc
and run the executable. If you are cross-compiling, you should try to do
this on a compute node.
Call Stack (most recent call first):
src/thirdparty/kokkos/cmake/kokkos_tribits.cmake:244 (INCLUDE)
src/thirdparty/kokkos/CMakeLists.txt:213 (KOKKOS_SETUP_BUILD_ENVIRONMENT)

-- Built-in Execution Spaces:
-- Device Parallel: Kokkos::Cuda
-- Host Parallel: Kokkos::OpenMP
-- Host Serial: NONE

-- Architectures:
-- Using internal desul_atomics copy
-- Kokkos Devices: OPENMP;CUDA, Kokkos Backends: OPENMP;CUDA
-- Boost.Math: standalone mode ON
-- pybind11 v2.9.2
-- kEDM build configuration:
-- C++ Compiler: GNU 11.4.0
-- /usr/bin/c++
-- CPU backend: ON
-- GPU backend: ON
-- Executables: ON
-- Python bindings: ON
-- MPI: OFF
-- Unit tests: ON
-- LIKWID: OFF
-- Scratch memory: ON
-- SIMD primitives: ON
-- Configuring incomplete, errors occurred!
See also "/home/david.wyrick/Git/kEDM/build/CMakeFiles/CMakeOutput.log".

corrcoef_state - correlation query w.r.t xmap

Sir,

This is a general query about corrcoef_state used in xmap (CCM).
(1) Is it correct to understand that the function corrcoef_state is used to find the correlation between source to target time series data inputs in xmap ?

(2) since CCM can work in non-linear data relationships, will corrcoef_state's correlation calculation work with time-series data under nonlinear relationships?

I also have a related generic CCM question after a cross-map prediction using nearest neighbors on X|Y(m) and Y||X(m), can we use Pearson correlation to finally arrive at the CCM correlation under an assumption that X and Y may have a nonlinear relationship?

Thanks in advance.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.