Skip to content
代码片段 群组 项目
提交 120ddbdf 编辑于 作者: Toshihiro Nakae's avatar Toshihiro Nakae
浏览文件

catch up save/restore features and some fixes

上级 be429054
无相关合并请求
......@@ -11,6 +11,7 @@ this is UNOFFICIAL implementation.
- python 3
- Tensorflow
- Numpy
- sklearn
# Usage instructions
To use DAGMM model, you need to create "DAGMM" object.
......@@ -35,7 +36,7 @@ At initialize, you have to specify next 4 variables at least.
Then you fit the training data, and predict to get energies
(anomaly score). It looks like the model interface of scikit-learn.
For more details, please check out dagmm/dagmm.py docstrings.
For more details, please check out [dagmm/dagmm.py](dagmm/dagmm.py) docstrings.
# Example
## Small Example
......@@ -55,12 +56,17 @@ model.fit(x_train)
# Evaluate energies
# (the more the energy is, the more it is anomary)
energy = model.predict(x_test)
# Save fitted model to the directory
model.save("./fitted_model")
# Restore saved model from dicrectory
model.restore("./fitted_model")
```
## Jupyter Notebook Example
You can use [jupyter notebook example](Example_DAGMM.ipynb).
This example uses random samples of mixture of gaussian.
(need sklearn)
# Notes
## GMM Implementation
......
......@@ -12,6 +12,7 @@ DAGMM (Deep Autoencoding Gaussian Mixture Model) の Tensorflow 実装です。
- python 3
- Tensorflow
- Numpy
- sklearn
# 利用方法
DAGMMを利用するには、まずDAGMMオブジェクトを生成します。
......@@ -36,7 +37,7 @@ DAGMMを利用するには、まずDAGMMオブジェクトを生成します。
その後、スコアを算出したいデータに対して予測(predict)を行います。
(scikit-learnにおける予測モデルの利用方法と似ています)
オプションの詳細については dagmm/dagmm.py の docstring を参照してください。
オプションの詳細については [dagmm/dagmm.py](dagmm/dagmm.py) の docstring を参照してください。
# 利用例
## シンプルな例
......@@ -56,12 +57,17 @@ model.fit(x_train)
# エネルギーの算出
# (エネルギーが高いほど異常)
energy = model.predict(x_test)
# 学習済みモデルをディレクトリに保存する
model.save("./fitted_model")
# 学習済みモデルをディレクトリから読み込む
model.restore("./fitted_model")
```
## Jupyter Notebook サンプル
Jupyter notebook での[実行サンプル](./Example_DAGMM_ja.ipynb)を用意しました。
このサンプルでは、混合正規分布に対して適用した結果となっています。
(sklearn が必要です)
# 補足
## 混合正規分布(GMM)の実装について
......
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册