未验证 提交 9688ca0a 编辑于 作者: Toshihiro NAKAE's avatar Toshihiro NAKAE 提交者: GitHub
浏览文件

Merge pull request #13 from tnakae/ParamTuning

Parameter Tuning
加载中
加载中
加载中
加载中
+21 −111

文件已更改。

预览已超出大小限制,变更已折叠。

+21 −111

文件已更改。

预览已超出大小限制,变更已折叠。

+8 −1
原始行号 差异行号 差异行
@@ -81,7 +81,14 @@ Instead, this implementation uses cholesky decomposition of covariance matrix.
In ``DAGMM.fit()``, it generates and stores triangular matrix of cholesky decomposition
of covariance matrix, and it is used in ``DAGMM.predict()``,

In addition to it, small perturbation (1e-3) is added to diagonal
In addition to it, small perturbation (1e-6) is added to diagonal
elements of covariance matrix for more numerical stability
(it is same as Tensorflow GMM implementation,
and [another author of DAGMM](https://github.com/danieltan07/dagmm) also points it out)

## Parameter of GMM Covariance ($\lambda_2$)
Default value of $\lambda_2$ is set to 0.0001 (0.005 in original paper).
When $\lambda_2$ is 0.005, covariances of GMM becomes too large to detect
anomaly points. But perhaps it depends on data and preprocessing
(for example a method of normalization). Recommended control $\lambda_2$
when performance metrics is not good.
+10 −1
原始行号 差异行号 差异行
@@ -81,8 +81,17 @@ Jupyter notebook での[実行サンプル](./Example_DAGMM_ja.ipynb)を用意
``DAGMM.fit()``において、共分散行列のコレスキー分解をしておき、算出された
三角行列を ``DAGMM.predict()`` で利用しています。

さらに、共分散行列の対角行列にあらかじめ小さな値(1e-3)を加えることで、
さらに、共分散行列の対角行列にあらかじめ小さな値(1e-6)を加えることで、
安定的にコレスキー分解ができるようにしています。
(Tensorflow の GMM でも同様のロジックがあり、
[DAGMMの別実装の実装者](https://github.com/danieltan07/dagmm)
同じ事情について言及しています)

## 共分散パラメータ $\lambda_2$ について
共分散の対角成分を制御するパラメータ $\lambda_2$ のデフォルト値は
0.0001 としてあります(論文では 0.005 がおすすめとなっている)
これは、0.005 とした場合に共分散が大きくなりすぎて、大きなクラスタ
が選ばれる傾向にあったためです。ただしこれはデータの傾向、および
前処理の手順(例えば、データの正規化の方法)にも依存すると考えられます。
意図した精度が得られない場合は、$\lambda_2$ の値をコントロールすることを
お勧めします。
+1 −1
原始行号 差异行号 差异行
@@ -25,7 +25,7 @@ class DAGMM:
    def __init__(self, comp_hiddens, comp_activation,
            est_hiddens, est_activation, est_dropout_ratio=0.5,
            minibatch_size=1024, epoch_size=100,
            learning_rate=0.0001, lambda1=0.1, lambda2=0.005,
            learning_rate=0.0001, lambda1=0.1, lambda2=0.0001,
            normalize=True, random_seed=123):
        """
        Parameters
加载中