Giter Club home page Giter Club logo

roerich's Issues

Unable to import roerich due to potential version mismatch

Hi,

Thanks for sharing the code. I was trying to follow the instructions for basic usage but got following error:

import roerich
Traceback (most recent call last):
  File "C:\Users\arago\.p2\pool\plugins\org.python.pydev.core_8.1.0.202012051215\pysrc\_pydevd_bundle\pydevd_exec2.py", line 3, in Exec
    exec(exp, global_vars, local_vars)
  File "<console>", line 1, in <module>
  File "C:\Users\arago\AppData\Local\Programs\Python\Python39\lib\site-packages\roerich\__init__.py", line 1, in <module>
    from .algorithms import OnlineNNClassifier, OnlineNNRuLSIF
  File "C:\Users\arago\AppData\Local\Programs\Python\Python39\lib\site-packages\roerich\algorithms.py", line 7, in <module>
    import torch
  File "C:\Users\arago\AppData\Local\Programs\Python\Python39\lib\site-packages\torch\__init__.py", line 196, in <module>
    from torch._C import *
RuntimeError: module compiled against API version 0xe but this version of numpy is 0xd

Thanks,
Rahul

How to tune the parameters of detection algorithms?

I use roerich on my own dataset, but the result is not so good.

figure

There are comments in the class ChangePointDetection:

    Parameters
    ----------
    scaler: A scaler object is used to scale an input data. The default one is `SmaScalerCache`
    metric: A loss function during optimize step of NN. Can be one of the following KL_sym, KL, JSD, PE, PE_sym, Wasserstein
    window_size: A size of a window when splitting input data into train and test arrays
    periods: A number of previous data-points used when constructing autoregressive matrix
    lag_size: A distance between train- and test- windows
    step: Each `step`-th data-point is used when creating the input dataset
    n_epochs: A number of epochs during training NN
    lr: A learning rate at each step of optimizer
    lam: A regularization rate
    optimizer: One of Adam, SGD, RMSprop or ASGD optimizers
    debug: default zero

How to tune the parameters of the change point algorithms, like periods, window_size , lag_size or step?

Multi parameters in Roerich

Hello!
Can I use not one, but several search parameters in the model Roerich for finding change point detections?

Error in example OnlineNNClassifier in docs/examples/demo.ipynb using net='default'

In the doc example demo.ipynb, the parameter net is initizlized with the string 'default':

cpd = OnlineNNClassifier(net='default', scaler="default", metric="KL_sym",
                         periods=1, window_size=1, lag_size=100, step=1, 
                         n_epochs=10, lr=0.1, lam=0.0001, optimizer="Adam")

which causes the folloing error when executing:

File ~\miniconda3\envs\cpt\Lib\site-packages\roerich\change_point\onnc.py:315 in predict
self._init_network(X_auto.shape[1])

File ~\miniconda3\envs\cpt\Lib\site-packages\roerich\change_point\onnc.py:176 in _init_network
self.net = self.base_net(n_inputs)

TypeError: 'str' object is not callable.

Using net='auto', it works.

File "2.py", line 33, in <module> score, peaks = cpd.predict(xx) File "/home/bcc1/anaconda3/lib/python3.8/site-packages/roerich/algorithms.py", line 101, in predict score = self.reference_test_predict(X_, y_) File "/home/bcc1/anaconda3/lib/python3.8/site-packages/roerich/algorithms.py", line 231, in reference_test_predict loss = self.criterion(outputs.squeeze(), y) File "/home/bcc1/anaconda3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl return forward_call(*input, **kwargs) File "/home/bcc1/anaconda3/lib/python3.8/site-packages/torch/nn/modules/loss.py", line 603, in forward return F.binary_cross_entropy(input, target, weight=self.weight, reduction=self.reduction) File "/home/bcc1/anaconda3/lib/python3.8/site-packages/torch/nn/functional.py", line 2916, in binary_cross_entropy return torch._C._nn.binary_cross_entropy(input, target, weight, reduction_enum) RuntimeError: all elements of input should be between 0 and 1

File "2.py", line 33, in
score, peaks = cpd.predict(xx)
File "/home/bcc1/anaconda3/lib/python3.8/site-packages/roerich/algorithms.py", line 101, in predict
score = self.reference_test_predict(X_, y_)
File "/home/bcc1/anaconda3/lib/python3.8/site-packages/roerich/algorithms.py", line 231, in reference_test_predict
loss = self.criterion(outputs.squeeze(), y)
File "/home/bcc1/anaconda3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
return forward_call(*input, **kwargs)
File "/home/bcc1/anaconda3/lib/python3.8/site-packages/torch/nn/modules/loss.py", line 603, in forward
return F.binary_cross_entropy(input, target, weight=self.weight, reduction=self.reduction)
File "/home/bcc1/anaconda3/lib/python3.8/site-packages/torch/nn/functional.py", line 2916, in binary_cross_entropy
return torch._C._nn.binary_cross_entropy(input, target, weight, reduction_enum)
RuntimeError: all elements of input should be between 0 and 1

ChangePointDetectionRuLSIF does not work on GPU

The following code

from roerich.change_point import ChangePointDetectionRuLSIF

alg = ChangePointDetectionRuLSIF()
alg.predict(np.zeros((500, 3))) # just for example

throws an error:
RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cpu and cuda:0! (when checking argument for argument mat1 in method wrapper_CUDA_addmm)

It works well on CPU, but when CUDA is available, the error appears.

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.