安装包版本
点击查看代码
完整的TadGan环境列表
(orion) C:\Users\User>pip list
WARNING: Ignoring invalid distribution -ensorflow-gpu (c:\users\user\appdata\roaming\python\python37\site-packages)
Package Version
--------------------------------------- ---------
absl-py 1.2.0
astor 0.8.1
astunparse 1.6.3
azure-cognitiveservices-anomalydetector 0.3.0
azure-common 1.1.28
azure-core 1.24.2
botocore 1.27.42
certifi 2022.6.15
charset-normalizer 2.1.0
click 8.1.3
cloudpickle 2.1.0
colorama 0.4.5
dask 2022.2.0
distributed 2022.2.0
docutils 0.15.2
featuretools 0.11.0
flatbuffers 2.0
fsspec 2022.7.1
future 0.18.2
gast 0.2.2
google-pasta 0.2.0
grpcio 1.48.0
h5py 2.10.0
HeapDict 1.0.1
idna 3.3
importlib-metadata 4.12.0
iso639 0.1.4
isodate 0.6.1
Jinja2 3.1.2
jmespath 1.0.1
joblib 1.1.0
Keras 2.3.1
Keras-Applications 1.0.8
Keras-Preprocessing 1.1.2
langdetect 1.0.9
lightfm 1.16
llvmlite 0.34.0
locket 1.0.0
Markdown 3.4.1
MarkupSafe 2.1.1
mlblocks 0.3.4
mlprimitives 0.2.5
mock 4.0.3
msgpack 1.0.4
msrest 0.7.1
networkx 2.6.3
nltk 3.7
numba 0.51.2
numpy 1.16.6
oauthlib 3.2.0
opencv-python 4.6.0.66
opt-einsum 3.3.0
orion-ml 0.3.2
packaging 21.3
pandas 0.24.2
partd 1.2.0
patsy 0.5.2
Pillow 9.2.0
pip 22.1.2
protobuf 3.20.1
psutil 5.9.1
pyparsing 3.0.9
python-dateutil 2.8.2
python-louvain 0.13
pyts 0.10.0
pytz 2022.1
PyWavelets 1.1.1
PyYAML 6.0
regex 2022.7.25
requests 2.28.1
requests-oauthlib 1.3.1
s3fs 0.4.2
scikit-image 0.14.5
scikit-learn 0.20.4
scipy 1.7.3
setuptools 61.2.0
six 1.16.0
smart-open 6.0.0
sortedcontainers 2.4.0
statsmodels 0.12.2
tabulate 0.8.10
tblib 1.7.0
tensorboard 1.15.0
tensorflow 1.15.5
tensorflow-cpu 1.15.0
tensorflow-cpu-estimator 1.15.1
tensorflow-estimator 1.15.1
termcolor 1.1.0
toolz 0.12.0
tornado 6.2
tqdm 4.64.0
typing_extensions 4.3.0
urllib3 1.26.11
Werkzeug 2.2.1
wheel 0.37.1
wincertstore 0.2
wrapt 1.14.1
xgboost 0.90
XlsxWriter 3.0.3
zict 2.2.0
zipp 3.8.1
WARNING: Ignoring invalid distribution -ensorflow-gpu (c:\users\user\appdata\roaming\python\python37\site-packages)
WARNING: Ignoring invalid distribution -ensorflow-gpu (c:\users\user\appdata\roaming\python\python37\site-packages)
WARNING: Ignoring invalid distribution -ensorflow-gpu (c:\users\user\appdata\roaming\python\python37\site-packages)
示例代码
点击查看代码
import numpy as np
from mlprimitives import load_primitive
X = np.array([1] * 100).reshape(1, -1, 1)
print(X.shape)
y = X[:, :, [0]] # signal to reconstruct from X (channel 0)
# 关键的模型配置文件在 orion.primitives.tadgan.TadGAN.json
primitive = load_primitive('orion.primitives.tadgan.TadGAN',
arguments={"X": X, "y": X, "epochs": 5, "batch_size": 1, "iterations_critic": 1})
primitive.fit()
# Epoch: 1/5, [Dx loss: [ 8.1564751e+00 -2.8269568e-02 -1.2753400e-03 8.1860197e-01]] [Dz loss: [ 1.5643368 -0.23620689 0.0099258 0.17906179]] [G loss: [1.0159907e+01 2.7486266e-04 9.8272383e-02 1.0061361e+00]]
# Epoch: 2/5, [Dx loss: [ 8.1122799e+00 2.5430264e-02 -5.7639816e-04 8.0874264e-01]] [Dz loss: [ 1.6766577 0.5785153 -0.23322849 0.13313708]] [G loss: [1.0037482e+01 1.5826018e-03 6.9854617e-02 9.9660456e-01]]
# Epoch: 3/5, [Dx loss: [ 7.8248177e+00 -1.0765485e-01 2.4232497e-03 7.9300493e-01]] [Dz loss: [ 2.9578063 1.347339 -0.10729899 0.17177662]] [G loss: [ 9.896642e+00 -4.145731e-03 7.847432e-02 9.822313e-01]]
# Epoch: 4/5, [Dx loss: [ 7.6695747 -0.13101332 0.00913733 0.77914506]] [Dz loss: [ 3.0698705 -0.06618145 -0.16412571 0.33001775]] [G loss: [ 9.235229 -0.01033833 0.15157706 0.909399 ]]
# Epoch: 5/5, [Dx loss: [ 7.3809795e+00 -2.5241375e-01 5.7032239e-03 7.6276898e-01]] [Dz loss: [ 3.2601674 0.6328457 -0.16581921 0.2793141 ]] [G loss: [ 8.786275 -0.02030257 -0.03958205 0.884616 ]]
y, critic = primitive.produce(X=X, y=y)
print("average reconstructed value: {:.2f}, critic score {:.2f}".format(y.mean(), critic[0][0]))
# average reconstructed value: 0.10, critic score 0.33
日志
点击查看代码
E:\Users\User\miniconda3\envs\orion\python.exe H:/AI_Gode/OrionDemo/TadGANDemo.py
(1, 100, 1)
E:\Users\User\miniconda3\envs\orion\lib\site-packages\sklearn\utils\validation.py:37: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
LARGE_SPARSE_SUPPORTED = LooseVersion(scipy_version) >= '0.14.0'
Using TensorFlow backend.
WARNING:tensorflow:From E:\Users\User\miniconda3\envs\orion\lib\site-packages\tensorflow_core\python\ops\resource_variable_ops.py:1630: calling BaseResourceVariable.__init__ (from tensorflow.python.ops.resource_variable_ops) with constraint is deprecated and will be removed in a future version.
Instructions for updating:
If using Keras pass *_constraint arguments to layers.
E:\Users\User\miniconda3\envs\orion\lib\site-packages\keras\engine\training.py:297: UserWarning: Discrepancy between trainable weights and collected trainable weights, did you set `model.trainable` without calling `model.compile` after ?
'Discrepancy between trainable weights and collected trainable'
WARNING:tensorflow:From E:\Users\User\miniconda3\envs\orion\lib\site-packages\tensorflow_core\python\ops\math_grad.py:1424: where (from tensorflow.python.ops.array_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use tf.where in 2.0, which has the same broadcast rule as np.where
2022-08-18 22:53:12.149362: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2
WARNING:tensorflow:From E:\Users\User\miniconda3\envs\orion\lib\site-packages\keras\backend\tensorflow_backend.py:422: The name tf.global_variables is deprecated. Please use tf.compat.v1.global_variables instead.
E:\Users\User\miniconda3\envs\orion\lib\site-packages\keras\engine\training.py:297: UserWarning: Discrepancy between trainable weights and collected trainable weights, did you set `model.trainable` without calling `model.compile` after ?
'Discrepancy between trainable weights and collected trainable'
2022-08-18 22:53:21.535270: E tensorflow/core/grappler/optimizers/dependency_optimizer.cc:697] Iteration = 0, topological sort failed with message: The graph couldn't be sorted in topological order.
2022-08-18 22:53:21.561498: E tensorflow/core/grappler/optimizers/dependency_optimizer.cc:697] Iteration = 1, topological sort failed with message: The graph couldn't be sorted in topological order.
2022-08-18 22:53:21.638274: E tensorflow/core/grappler/optimizers/meta_optimizer.cc:533] model_pruner failed: Invalid argument: MutableGraphView::MutableGraphView error: node 'loss_2/model_2_loss/mean_squared_error/weighted_loss/concat' has self cycle fanin 'loss_2/model_2_loss/mean_squared_error/weighted_loss/concat'.
2022-08-18 22:53:21.816719: E tensorflow/core/grappler/optimizers/meta_optimizer.cc:533] remapper failed: Invalid argument: MutableGraphView::MutableGraphView error: node 'loss_2/model_2_loss/mean_squared_error/weighted_loss/concat' has self cycle fanin 'loss_2/model_2_loss/mean_squared_error/weighted_loss/concat'.
2022-08-18 22:53:21.838843: E tensorflow/core/grappler/optimizers/meta_optimizer.cc:533] arithmetic_optimizer failed: Invalid argument: The graph couldn't be sorted in topological order.
2022-08-18 22:53:21.860367: E tensorflow/core/grappler/optimizers/dependency_optimizer.cc:697] Iteration = 0, topological sort failed with message: The graph couldn't be sorted in topological order.
2022-08-18 22:53:21.883567: E tensorflow/core/grappler/optimizers/dependency_optimizer.cc:697] Iteration = 1, topological sort failed with message: The graph couldn't be sorted in topological order.
Epoch: 1/5, [Dx loss: [ 7.31224775e+00 -1.19276665e-01 1.84259005e-03 7.42968202e-01]] [Dz loss: [ 0.3067557 -0.44634065 -0.05312024 0.08062166]] [G loss: [1.0106481e+01 6.5685640e-04 1.1010410e-01 9.9957198e-01]]
E:\Users\User\miniconda3\envs\orion\lib\site-packages\keras\engine\training.py:297: UserWarning: Discrepancy between trainable weights and collected trainable weights, did you set `model.trainable` without calling `model.compile` after ?
'Discrepancy between trainable weights and collected trainable'
Epoch: 2/5, [Dx loss: [ 7.1483636e+00 -5.6659371e-02 3.4755275e-03 7.2015476e-01]] [Dz loss: [ 1.3778638 -0.25603315 0.20017634 0.14337206]] [G loss: [ 9.6632853e+00 -2.9747246e-03 -1.9676825e-01 9.8630285e-01]]
Epoch: 3/5, [Dx loss: [7.0703130e+00 5.3725705e-02 4.7316586e-05 7.0165402e-01]] [Dz loss: [1.1239426 0.0685184 0.26869762 0.07867266]] [G loss: [ 8.9385529e+00 4.8824699e-04 -6.8461269e-01 9.6226776e-01]]
Epoch: 4/5, [Dx loss: [ 6.459007 -0.24500221 -0.00741195 0.6711421 ]] [Dz loss: [ 2.014074 -0.9310748 1.6808544 0.12642944]] [G loss: [ 7.505266 -0.0102396 -1.6289722 0.9144478]]
Epoch: 5/5, [Dx loss: [ 5.989165 -0.35496444 0.02346188 0.6320667 ]] [Dz loss: [3.7862666 0.18001929 2.4950943 0.11111528]] [G loss: [ 5.4227304 -0.03419049 -2.8799427 0.83368635]]
average reconstructed value: 0.13, critic score 0.43
Process finished with exit code 0