Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GDN algorithm #16

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Add GDN algorithm #16

wants to merge 6 commits into from

Conversation

SebastianSchmidl
Copy link
Member

@SebastianSchmidl
Copy link
Member Author

SebastianSchmidl commented Jun 30, 2023

@2er0 can you take it from here?

  • add source code within the given template (transform data and set the parameters)
  • check parameter definitions in algorithm.py (name, type, default value, and their completeness)
  • check parameter definitions in manifest.json (consistent with algorithm.py and descriptions)
  • adapt implementation to correctly save the model
  • check if the algorithm successfully trains and executes (I can help with that)
  • does the algorithm need reverse windowing? add a note in the README

@2er0
Copy link
Collaborator

2er0 commented Sep 21, 2023

@CodeLionX please test - I found some time to make the first full working draft.

docker build -t registry.gitlab.hpi.de/akita/i/python3-base:0.2.6 ./0-base-images/python3-base 
docker build -t registry.gitlab.hpi.de/akita/i/python3-torch:0.2.6 ./0-base-images/python3-torch
docker build -t registry.gitlab.hpi.de/akita/i/gdn:0.2.6 ./gdn

docker run --rm \                                                                               
    -v $(pwd)/1-data:/data:ro \
    -v $(pwd)/2-results:/results:rw \
  registry.gitlab.hpi.de/akita/i/gdn:0.2.6 execute-algorithm '{
    "executionType": "train",
    "dataInput": "/data/multi-dataset.csv",
    "dataOutput": "/results/anomaly_scores.ts",
    "modelInput": "/results/model.pkl",
    "modelOutput": "/results/model.pkl",
    "customParameters": {}
  }'

docker run --rm \                                                                               
    -v $(pwd)/1-data:/data:ro \
    -v $(pwd)/2-results:/results:rw \
  registry.gitlab.hpi.de/akita/i/gdn:0.2.6 execute-algorithm '{
    "executionType": "execute",
    "dataInput": "/data/multi-dataset.csv",
    "dataOutput": "/results/test_anomaly_scores.ts",
    "modelInput": "/results/model.pkl",
    "modelOutput": "/results/model.pkl",
    "customParameters": {}
  }'

Copy link
Member Author

@SebastianSchmidl SebastianSchmidl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I took a brief look and can execute the algorithm locally. 👍🏼
However, I found some issues in the current draft:

  • See inline comments (changes to base image)
  • The input handling is too tight: You assume that the feature columns are labeled value*, but many datasets use other feature names.
  • All other algorithms store a single model-file. TimeEval currently does not support multiple files. I would suggest that you create an archive when storing the model. You can take a look at Torsk as an example for that.
  • Do you perform train-test-splitting within the code? The anomaly score files are very short … TimeEval requires that the scoring has the same length as the input TS. You could use a postprocessing step to perform this transformation (allows you to use Code from TimeEval).

Comment on lines +1 to +5
numpy>=1.20.0
pandas>=1.2.1
matplotlib>=3.3.4
scipy>=1.6.0
scikit-learn>=0.24.1
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We deliberately pinned the dependencies to ensure reproducibility!

If the new algorithm actually needs a new Python version and different dependencies, we should create a new base image. Otherwise, we have to check if all the other algorithms still work with the new base image.

Comment on lines -181 to +184
# -e LOCAL_UID=<current user id> \
# -e LOCAL_GID=<current groupid> \
registry.gitlab.hpi.de/akita/i/<your_algorithm>:latest execute-algorithm '{
registry.gitlab.hpi.de/akita/i/gdn:0.2.6 execute-algorithm '{
"executionType": "train",
"dataInput": "/data/dataset.csv",
"dataInput": "/data/multi-dataset.csv",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please revert those changes to the README. They only apply to your algorithm and not to the others.

@@ -0,0 +1,18 @@
FROM registry.gitlab.hpi.de/akita/i/python3-torch:0.2.6
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no version 0.2.6 of the base images yet.

Comment on lines +17 to +18
# fixing six.py dataloader issue
COPY GDN/dataloader_fix.py /usr/local/lib/python3.10/site-packages/torch_geometric/data/dataloader.py
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have a link to the bug report/issue? This looks like a dirty hack.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add GDN algorithm
2 participants