-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #585 from RaymondY/development
Add PyTorch Version of VAE, AE, SO_GAAL based on the DL base detector && Fix some bugs in DL base detector.
- Loading branch information
Showing
16 changed files
with
1,254 additions
and
1,654 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
# -*- coding: utf-8 -*- | ||
"""Example of using Variational Auto Encoder for outlier detection | ||
""" | ||
# Author: Andrij Vasylenko <[email protected]> | ||
# Author: Tiankai Yang <[email protected]> | ||
# License: BSD 2 clause | ||
|
||
from __future__ import division | ||
|
@@ -14,6 +14,7 @@ | |
# if pyod is installed, no need to use the following line | ||
sys.path.append( | ||
os.path.abspath(os.path.join(os.path.dirname("__file__"), '..'))) | ||
sys.path.append(os.path.abspath(os.path.dirname("__file__"))) | ||
|
||
from pyod.models.vae import VAE | ||
from pyod.utils.data import generate_data | ||
|
@@ -35,7 +36,7 @@ | |
|
||
# train VAE detector (Beta-VAE) | ||
clf_name = 'VAE' | ||
clf = VAE(epochs=30, contamination=contamination, gamma=0.8, capacity=0.2) | ||
clf = VAE(epoch_num=30, contamination=contamination, beta=0.8, capacity=0.2) | ||
clf.fit(X_train) | ||
|
||
# get the prediction labels and outlier scores of the training data | ||
|
Oops, something went wrong.