Skip to content
GitLab
探索
登录
注册
主导航
搜索或转到…
项目
D
DAGMM
管理
动态
成员
标记
计划
议题
0
议题看板
里程碑
Wiki
代码
合并请求
0
仓库
分支
提交
标签
仓库图
比较修订版本
代码片段
构建
流水线
作业
流水线计划
产物
部署
发布
软件包库
运维
环境
Terraform 模块
监控
事件
服务台
分析
价值流分析
Contributor analytics
CI/CD 分析
仓库分析
模型实验
帮助
帮助
支持
GitLab 文档
比较 GitLab 各版本
社区论坛
为极狐GitLab 提交贡献
提交反馈
快捷键
?
支持
扫码加入微信群
1. 获取企业级DevOps解决方案
2. 免费或优惠考取极狐GitLab官方培训认证
代码片段
群组
项目
AIOps-NanKai
model
DAGMM
提交
be429054
未验证
提交
be429054
编辑于
6年前
作者:
Toshihiro NAKAE
提交者:
GitHub
6年前
浏览文件
操作
下载
差异文件
Merge pull request #11 from tnakae/ShuffleTrainingData
shuffle training data (fixed #8)
上级
7b024009
be9f4def
分支
分支 包含提交
无相关合并请求
变更
1
隐藏空白变更内容
行内
左右并排
显示
1 个更改的文件
dagmm/dagmm.py
+6
-1
6 个添加, 1 个删除
dagmm/dagmm.py
有
6 个添加
和
1 个删除
dagmm/dagmm.py
+
6
−
1
浏览文件 @
be429054
import
tensorflow
as
tf
import
tensorflow
as
tf
import
numpy
as
np
from
sklearn.preprocessing
import
StandardScaler
from
sklearn.preprocessing
import
StandardScaler
from
sklearn.externals
import
joblib
from
sklearn.externals
import
joblib
...
@@ -105,6 +106,7 @@ class DAGMM:
...
@@ -105,6 +106,7 @@ class DAGMM:
with
tf
.
Graph
().
as_default
()
as
graph
:
with
tf
.
Graph
().
as_default
()
as
graph
:
self
.
graph
=
graph
self
.
graph
=
graph
tf
.
set_random_seed
(
self
.
seed
)
tf
.
set_random_seed
(
self
.
seed
)
np
.
random
.
seed
(
seed
=
self
.
seed
)
# Create Placeholder
# Create Placeholder
self
.
input
=
input
=
tf
.
placeholder
(
self
.
input
=
input
=
tf
.
placeholder
(
...
@@ -137,11 +139,14 @@ class DAGMM:
...
@@ -137,11 +139,14 @@ class DAGMM:
self
.
sess
.
run
(
init
)
self
.
sess
.
run
(
init
)
# Training
# Training
idx
=
np
.
arange
(
x
.
shape
[
0
])
np
.
random
.
shuffle
(
idx
)
for
epoch
in
range
(
self
.
epoch_size
):
for
epoch
in
range
(
self
.
epoch_size
):
for
batch
in
range
(
n_batch
):
for
batch
in
range
(
n_batch
):
i_start
=
batch
*
self
.
minibatch_size
i_start
=
batch
*
self
.
minibatch_size
i_end
=
(
batch
+
1
)
*
self
.
minibatch_size
i_end
=
(
batch
+
1
)
*
self
.
minibatch_size
x_batch
=
x
[
i_start
:
i_end
]
x_batch
=
x
[
idx
[
i_start
:
i_end
]
]
self
.
sess
.
run
(
minimizer
,
feed_dict
=
{
self
.
sess
.
run
(
minimizer
,
feed_dict
=
{
input
:
x_batch
,
drop
:
self
.
est_dropout_ratio
})
input
:
x_batch
,
drop
:
self
.
est_dropout_ratio
})
...
...
This diff is collapsed.
Click to expand it.
预览
0%
请重试
或
添加新附件
.
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
保存评论
取消
想要评论请
注册
或
登录