-
大小: 23.9MB文件类型: .zip金币: 1下载: 0 次发布日期: 2023-07-23
- 语言: 其他
- 标签: DBN 故障诊断 tensorflow
资源简介
使用DBN模型进行故障诊断,故障类型为4类,每类训练集为400个,测试20个。
代码片段和文件信息
# -*- coding: utf-8 -*-
import tensorflow as tf
import numpy as np
import os
import matplotlib.pyplot as plt
class Batch(object):
def __init__(self
images=None
labels=None
batch_size=None
shuffle=True):
self.images = images
if labels is None:
self.exit_y = False
else:
self.exit_y = True
self.labels = labels
self.batch_size = batch_size
self.shuffle = shuffle
self._images = images
self._labels = labels
self._num_examples = images.shape[0]
self._epochs_completed = 0
self._index_in_epoch = 0
def next_batch(self):
“““Return the next ‘batch_size‘ examples from this data set.“““
start = self._index_in_epoch
# Shuffle for the first epoch
if self._epochs_completed == 0 and start == 0 and self.shuffle:
perm0 = np.arange(self._num_examples)
np.random.shuffle(perm0)
self._images = self.images[perm0]
if self.exit_y: self._labels = self.labels[perm0]
# Go to the next epoch
if start + self.batch_size > self._num_examples:
# Finished epoch
self._epochs_completed += 1
# Get the rest examples in this epoch
rest_num_examples = self._num_examples - start
images_rest_part = self._images[start:self._num_examples]
if self.exit_y: labels_rest_part = self._labels[start:self._num_examples]
# Shuffle the data
if self.shuffle:
perm = np.arange(self._num_examples)
np.random.shuffle(perm)
self._images = self.images[perm]
if self.exit_y: self._labels = self.labels[perm]
# Start next epoch
start = 0
self._index_in_epoch = self.batch_size - rest_num_examples
end = self._index_in_epoch
images_new_part = self._images[start:end]
if self.exit_y:
labels_new_part = self._labels[start:end]
return np.concatenate((images_rest_part images_new_part) axis=0) np.concatenate((labels_rest_part labels_new_part) axis=0)
else:
return np.concatenate((images_rest_part images_new_part) axis=0)
else:
self._index_in_epoch += self.batch_size
end = self._index_in_epoch
if self.exit_y:
return self._images[start:end] self._labels[start:end]
else:
return self._images[start:end]
def act_func(func_name):
if func_name==‘sigmoid‘: # S(z) = 1/(1+exp(-z)) ∈ (01)
return tf.nn.sigmoid
elif func_name==‘softmax‘: # s(z) = S(z)/∑S(z) ∈ (01)
return tf.nn.softmax
elif func_name==‘relu‘: # r(z) = max(0z) ∈ (0+inf)
return tf.nn.relu
elif func_name==‘tanh‘: # r(z) = max(0z) ∈ (0+i
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2018-10-06 10:45 DBN\
文件 1972722 2018-09-26 18:24 DBN\DBN代码说明(05.23版).pptx
目录 0 2018-10-05 17:58 DBN\Tensorflow-Deep-Neural-Networks-master\
文件 1616 2018-07-14 10:23 DBN\Tensorflow-Deep-Neural-Networks-master\README.md
目录 0 2018-10-02 08:15 DBN\Tensorflow-Deep-Neural-Networks-master\ba
文件 329 2018-07-14 10:23 DBN\Tensorflow-Deep-Neural-Networks-master\ba
目录 0 2018-10-02 08:21 DBN\Tensorflow-Deep-Neural-Networks-master\ba
文件 9394 2018-10-02 08:21 DBN\Tensorflow-Deep-Neural-Networks-master\ba
文件 8492 2018-09-29 11:08 DBN\Tensorflow-Deep-Neural-Networks-master\ba
文件 10706 2018-09-29 11:08 DBN\Tensorflow-Deep-Neural-Networks-master\ba
目录 0 2018-10-02 08:15 DBN\Tensorflow-Deep-Neural-Networks-master\dataset\
目录 0 2018-10-02 08:32 DBN\Tensorflow-Deep-Neural-Networks-master\dataset\MNIST_data\
文件 1648877 2018-07-14 10:23 DBN\Tensorflow-Deep-Neural-Networks-master\dataset\MNIST_data\t10k-images-idx3-ubyte.gz
文件 4542 2018-07-14 10:23 DBN\Tensorflow-Deep-Neural-Networks-master\dataset\MNIST_data\t10k-labels-idx1-ubyte.gz
文件 564987 2018-09-30 09:45 DBN\Tensorflow-Deep-Neural-Networks-master\dataset\MNIST_data\test_data.mat
文件 199 2018-10-01 16:27 DBN\Tensorflow-Deep-Neural-Networks-master\dataset\MNIST_data\test_label.mat
文件 9912422 2018-07-14 10:23 DBN\Tensorflow-Deep-Neural-Networks-master\dataset\MNIST_data\train-images-idx3-ubyte.gz
文件 28881 2018-07-14 10:23 DBN\Tensorflow-Deep-Neural-Networks-master\dataset\MNIST_data\train-labels-idx1-ubyte.gz
文件 2821026 2018-09-30 09:44 DBN\Tensorflow-Deep-Neural-Networks-master\dataset\MNIST_data\train_data.mat
文件 213 2018-10-01 15:58 DBN\Tensorflow-Deep-Neural-Networks-master\dataset\MNIST_data\train_label.mat
目录 0 2018-10-02 08:15 DBN\Tensorflow-Deep-Neural-Networks-master\models\
目录 0 2018-10-02 08:21 DBN\Tensorflow-Deep-Neural-Networks-master\models\__pycache__\
文件 4217 2018-10-02 08:21 DBN\Tensorflow-Deep-Neural-Networks-master\models\__pycache__\cnn.cpython-35.pyc
文件 3735 2018-09-19 09:46 DBN\Tensorflow-Deep-Neural-Networks-master\models\__pycache__\cnn.cpython-36.pyc
文件 3684 2018-10-02 08:21 DBN\Tensorflow-Deep-Neural-Networks-master\models\__pycache__\dbn.cpython-35.pyc
文件 3238 2018-09-29 11:05 DBN\Tensorflow-Deep-Neural-Networks-master\models\__pycache__\dbn.cpython-36.pyc
文件 9539 2018-10-02 08:21 DBN\Tensorflow-Deep-Neural-Networks-master\models\__pycache__\model.cpython-35.pyc
文件 8510 2018-09-19 09:44 DBN\Tensorflow-Deep-Neural-Networks-master\models\__pycache__\model.cpython-36.pyc
文件 3661 2018-10-02 08:21 DBN\Tensorflow-Deep-Neural-Networks-master\models\__pycache__\rbm.cpython-35.pyc
文件 3320 2018-09-19 09:44 DBN\Tensorflow-Deep-Neural-Networks-master\models\__pycache__\rbm.cpython-36.pyc
文件 1632 2018-10-02 08:21 DBN\Tensorflow-Deep-Neural-Networks-master\models\__pycache__\rbms.cpython-35.pyc
............此处省略39个文件信息
- 上一篇:中国城市统计年鉴
- 下一篇:CTF抓包改包工具burpsuite专业版破解
相关资源
- TensorFlow机器学习实战指南
- Learning TensorFlow.pdf
- 21个项目玩转深度学习
- DnCNN-tensorflow版本
- 好用的标图工具
- TensorFlow实战Google深度学习框架(第
- TensorFlow深度学习应用实践_源码(2/
- tensorflow_gpu-1.13.1-cp36win64.whl
- tensorflow_gpu-1.13.1+nv19.5-cp36-cp36m-linux_
- cudnn-10.0-windows10-x64-v7.6.0.64.rar
- tensorflow的模型
- tensorflow_gpu-2.0.0a0-cp35-cp35m-win_amd64(
- TensorFlow-inception
- 强化学习精要 核心算法与TensorFlow实现
- deepFM实现基于TensorFlow
- 基于深度学习的人脸表情识别Tensorf
- 《深入理解TensorFlow架构设计与实现原
- 《TensorFlow快速入门与实战》.zip
- cuDNN7.3.1
- Hands-On.Machine.Learning.with.Scikit-Lear
- 西储大学12K驱动端轴承数据库数据,
- Reinforcement Learning with Tensorflow 无水印
- BUILDING MACHINE LEARNING PROJECTS WITH TENSOR
- cifar10_cnn 模型文件
- Scikit-Learn与TensorFlow机器学习实用指南
- 一种图像识别,基于TensorFlow训练,识
- Tensorflow实现Mnist手写数据集的识别
- TensorFlow for Deep Learning: From Linear Regr
- tensorflow-densenet-resnet-inception网络
- SegNet-tensorflow+dataset
评论
共有 条评论