Skip to content

Commit

Permalink
partial update of alad
Browse files Browse the repository at this point in the history
  • Loading branch information
yzhao062 authored and yzhao062 committed Sep 15, 2022
1 parent 5dff3a7 commit 3a524d8
Show file tree
Hide file tree
Showing 7 changed files with 296 additions and 227 deletions.
1 change: 1 addition & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -169,3 +169,4 @@ v<1.0.4>, <07/29/2022> -- Add LUNAR (#413).
v<1.0.4>, <07/29/2022> -- Add LUNAR (#415).
v<1.0.5>, <07/29/2022> -- Import optimization.
v<1.0.5>, <08/27/2022> -- Code optimization.
v<1.0.5>, <09/14/2022> -- Add ALAD.
9 changes: 9 additions & 0 deletions docs/pyod.models.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@ pyod.models.abod module
:show-inheritance:
:inherited-members:

pyod.models.alad module
-----------------------

.. automodule:: pyod.models.alad
:members:
:undoc-members:
:show-inheritance:
:inherited-members:

pyod.models.anogan module
-------------------------

Expand Down
9 changes: 9 additions & 0 deletions docs/zreferences.bib
Original file line number Diff line number Diff line change
Expand Up @@ -458,4 +458,13 @@ @inproceedings{you2017provable
booktitle={Proceedings of the IEEE conference on computer vision and pattern recognition},
pages={3395--3404},
year={2017}
}

@inproceedings{zenati2018adversarially,
title={Adversarially learned anomaly detection},
author={Zenati, Houssam and Romain, Manon and Foo, Chuan-Sheng and Lecouat, Bruno and Chandrasekhar, Vijay},
booktitle={2018 IEEE International conference on data mining (ICDM)},
pages={727--736},
year={2018},
organization={IEEE}
}
35 changes: 18 additions & 17 deletions examples/alad_example.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
"""Example of using Adversarially Learned Anomaly Detection(ALAD) for outlier detection
"""Example of using Adversarially Learned Anomaly Detection (ALAD) for outlier
detection
"""
from __future__ import division
from __future__ import print_function
Expand Down Expand Up @@ -33,22 +34,22 @@

# train ALAD detector
clf_name = 'ALAD'
clf = ALAD( epochs = 100, latent_dim = 2,
learning_rate_disc = 0.0001,
learning_rate_gen = 0.0001,
dropout_rate = 0.2,
add_recon_loss = False,
lambda_recon_loss= 0.05,
add_disc_zz_loss = True,
dec_layers=[ 75, 100 ],
enc_layers=[ 100, 75 ],
disc_xx_layers= [ 100, 75 ],
disc_zz_layers= [ 25, 25 ],
disc_xz_layers= [ 100, 75 ],
spectral_normalization = False,
activation_hidden_disc = 'tanh', activation_hidden_gen = 'tanh' ,
preprocessing=True, batch_size = 200, contamination = contamination)
clf = ALAD(epochs=100, latent_dim=2,
learning_rate_disc=0.0001,
learning_rate_gen=0.0001,
dropout_rate=0.2,
add_recon_loss=False,
lambda_recon_loss=0.05,
add_disc_zz_loss=True,
dec_layers=[75, 100],
enc_layers=[100, 75],
disc_xx_layers=[100, 75],
disc_zz_layers=[25, 25],
disc_xz_layers=[100, 75],
spectral_normalization=False,
activation_hidden_disc='tanh', activation_hidden_gen='tanh',
preprocessing=True, batch_size=200, contamination=contamination)

clf.fit(X_train)

# get the prediction labels and outlier scores of the training data
Expand Down
Loading

0 comments on commit 3a524d8

Please sign in to comment.