Skip to content

Commit

Permalink
feat: add MSL and SMAP
Browse files Browse the repository at this point in the history
  • Loading branch information
wQvaale committed Mar 23, 2021
1 parent 587b2cb commit ca6bf70
Show file tree
Hide file tree
Showing 133 changed files with 344 additions and 93,818 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/black.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ jobs:
python-version: 3.8
- name: Install Black
run: pip install black
- name: Run black --check .
run: black --check .
- name: Run black with line length 120
run: black --check . -l 120
8 changes: 5 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@
__pycache__/
.idea/
.DS_Store
datasets/household_power_consumption.csv
datasets/ecg_data.txt
datasets/ServerMachineDataset/processed/
/datasets/data/processed/
/datasets/data/test/
/datasets/data/train/
eda/.ipynb_checkpoints/
ServerMachineDataset/processed/
plots/
*.pkl
models/
output/smd/*/logs
output/smd/*/preds.pkl
output/smd/*/anomaly_preds.pkl
output/smd/*/anomaly_preds.pkl
59 changes: 59 additions & 0 deletions args.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import argparse


def get_parser():
parser = argparse.ArgumentParser()

# Data params
parser.add_argument("--dataset", type=str.upper, default="SMD")
parser.add_argument(
"--group",
type=str,
default="1-1",
help="Required for smd dataset. <group_index>-<index>",
)
parser.add_argument("--lookback", type=int, default=100)
parser.add_argument("--horizon", type=int, default=1)
parser.add_argument("--target_col", type=int, default=None)

# Model params
parser.add_argument("--kernel_size", type=int, default=7)
parser.add_argument("--gru_layers", type=int, default=1)
parser.add_argument("--gru_hid_dim", type=int, default=150)
parser.add_argument("--autoenc_layers", type=int, default=1)
parser.add_argument("--autoenc_hid_dim", type=int, default=128)
parser.add_argument("--fc_layers", type=int, default=3)
parser.add_argument("--fc_hid_dim", type=int, default=150)

# Train params
parser.add_argument("--test_size", type=float, default=0.2)
parser.add_argument("--epochs", type=int, default=100)
parser.add_argument("--bs", type=int, default=256)
parser.add_argument("--init_lr", type=float, default=1e-3)
parser.add_argument("--val_split", type=float, default=0.1)
parser.add_argument("--shuffle_dataset", type=bool, default=True)
parser.add_argument("--dropout", type=float, default=0.3)
parser.add_argument("--use_cuda", type=bool, default=True)
parser.add_argument("--model_path", type=str, default="models")
parser.add_argument("--print_every", type=int, default=1)

# Predictor args
parser.add_argument(
"--save_scores",
type=bool,
default=True,
help="To save anomaly scores predicted.",
)
parser.add_argument(
"--load_scores",
type=bool,
default=False,
help="To use already computed anomaly scores",
)
parser.add_argument("--gamma", type=float, default=1)
parser.add_argument("--level", type=float, default=None)

# Other
parser.add_argument("--comment", type=str, default="")

return parser
Loading

0 comments on commit ca6bf70

Please sign in to comment.