当前位置: 首页 > news >正文

1.4 基于模拟退火改进蛇算法优化VGG13SE网络超参数的故障诊断模型

本博客来源于CSDN机器鱼,未同意任何人转载。

更多内容,欢迎点击本专栏,查看更多内容。

目录

0 引言

1 改进原理

2 本文改进方法

3 改进蛇优化VGG13SE的故障诊断模型

4 结语


0 引言

在【博客】中,我们采用了蛇算法来对VGG13SE网络的15个超参数进行优化,为进一步提高论文的充实性,体现工作量,我们将对原始的蛇算法进行改进,具体是在蛇算法中融入模拟退火的思路。

1 改进原理

我个人认为所有的智能优化算法都是以下步骤组成:

        步骤1.初始化。种群随机初始化获得初始最优解与初始最优适应度。
        步骤2.寻优过程。进入for循环,利用更新公式对种群中的每个个体进行的位置(解)移动,并计算更新后的解对应的新适应度值。如果新适应度比旧的适应度更优,则更新每个个体的解与其适应度值。

        步骤3.最优解更新。将种群的每个个体的适应度与最优适应度进行比较,如果个体的适应度更优,则更新最优适应度与最优解。

        步骤4.寻优结束。一般是for结束退出,或者是达到了需要的值退出。

其中步骤3、4是固定的,没办法改。因此常见的改进都是对步骤1与步骤2改进。

改进步骤1的文章认为随机初始化并不是真正的随机,初始种群不会都遍布寻优空间,就跟吃鸡跳伞一样,最理想的情况肯定是整个地图均匀分布,但实际上很多人会集中往某个区域跳,那万一98k就在那些没得人覆盖的地方喃。因此改进步骤1就是用更均匀的方法让初始化解遍布寻优空间。

改进步骤2的一般有四种情况:

        ①发现了原作者的公式存在某些弊端,显然咱只是用一下而已,根本不去管公式啥样,从3月29日写代码到4月2日写到这篇博客,蛇算法我都没看过公式与原理;

        ②针对算法的某些固定的参数进行动态更新,就像吃鸡找装备一样,在空旷的区域可以快速跑动找建筑物,但是进建筑物之后要慢慢走,才能找到好的装备,观察可以发现SO算法有food_threshold 、temp_threshold 、c1 、model_threshold 、c2 、c3这些参数可以更新,举个例子,程序中c1=0.5改成c1min=0.1,c1max=0.5,然后在第一行加一句c1=c1min+(c1max-c1min)*t/max_iter,这样操作就让c1变成了动态更新值(随便写的,没试过效果,只是举个例子)。

        ③给算法加上随机变异,此部分人认为算法在后期可能会陷入局部最优解,就像吃鸡要是一开始方向就跑错了,结果玩半天都只找到一个波波枪,要是能随机将自己传送到其他建筑物里面该多好,说不定就能找到好的装备。

        ④继续堆公式,在算法里面加入其他算法的思想,本来人家循环一次已经完成一次更新了,但在后面再加个公式,让其再更新一次,这样当然效果更好,但同时消耗的时间也更长。

        应该还存在其他改进方式,我不是专门做优化算法的,不是很懂这个。

2 本文改进方法

本文分别对步骤1与2进行一次改进,步骤1的随机初始化加上Tent映射,让初始化分布更均匀;在步骤2在更新完毕之后,再进行一次模拟退火更新。具体代码如下:


'''tent映射'''
def tent(dim):x=np.zeros([dim])x[0]=np.random.rand()#初始点a=0.7 #参数a的值for i in range(dim-1):if x[i]<a:x[i+1]=x[i]/aelse:x[i+1]=(1-x[i]) / (1 - a)return x
''' Tent种群初始化函数 '''
def initialnew(pop, dim, ub, lb):X = np.zeros([pop, dim])for i in range(pop):tentvalue=tent(dim)for j in range(dim):X[i, j] = tentvalue[j]*(ub - lb) + lbreturn X
# 修正后的邻域生成函数
def neighbor(x, solution_bound):perturbation = np.random.uniform(-1, 1, size=x.shape)x_new = x + perturbation# 确保扰动后仍在边界内x_new = np.clip(x_new, solution_bound[0], solution_bound[1])return x_newdef sa_snake_optimization(search_agents_no, max_iter, dim, solution_bound):# 参数初始化T = 1000T_min = 0.01alpha = 0.9vec_flag = [1, -1]food_threshold = 0.25temp_threshold = 0.6c1 = 0.5model_threshold = 0.6c2 = 0.5c3 = 2# 种群初始化(使用numpy数组代替矩阵)#X = solution_bound[0] + np.random.rand(search_agents_no, dim) * (solution_bound[1] - solution_bound[0])X = initialnew(search_agents_no, dim, solution_bound[1] ,  solution_bound[0]) #初始化种群# 适应度计算fitness = np.array([chung_reynolds(x) for x in X])g_best_idx = np.argmin(fitness)food = X[g_best_idx].copy()gy_best = fitness[g_best_idx]# 性别分组male_number = search_agents_no // 2female_number = search_agents_no - male_numbermale = X[:male_number].copy()female = X[male_number:].copy()# 性别相关参数male_fitness = fitness[:male_number]female_fitness = fitness[male_number:]male_best_idx = np.argmin(male_fitness)male_best = male_fitness[male_best_idx]male_best_solution = male[male_best_idx].copy()female_best_idx = np.argmin(female_fitness)female_best = female_fitness[female_best_idx]female_best_solution = female[female_best_idx].copy()gene_best = np.zeros(max_iter)for t in range(max_iter):temp = math.exp(-t / max_iter)quantity = c1 * math.exp((t - max_iter) / max_iter)quantity = min(quantity, 1)new_male = male.copy()new_female = female.copy()if quantity < food_threshold:# 无食物模式for i in range(male_number):leader = random.choice(male)am = math.exp(-(chung_reynolds(leader) / (male_fitness[i] + 1e-30)))direction = random.choice(vec_flag)new_male[i] = leader + direction * c2 * am * np.random.rand(dim) * (solution_bound[1] - solution_bound[0])for i in range(female_number):leader = random.choice(female)am = math.exp(-(chung_reynolds(leader) / (female_fitness[i] + 1e-30)))direction = random.choice(vec_flag)new_female[i] = leader + direction * c2 * am * np.random.rand(dim) * (solution_bound[1] - solution_bound[0])else:if temp > temp_threshold:# 热态探索for i in range(male_number):direction = random.choice(vec_flag)new_male[i] = food + direction * c3 * temp * np.random.rand(dim) * (food - male[i])for i in range(female_number):direction = random.choice(vec_flag)new_female[i] = food + direction * c3 * temp * np.random.rand(dim) * (food - female[i])else:if random.random() < model_threshold:# 战斗模式for i in range(male_number):fm = math.exp(-female_best / (male_fitness[i] + 1e-30))direction = random.choice(vec_flag)new_male[i] = male[i] + direction * c3 * fm * np.random.rand(dim) * (quantity * male_best_solution - male[i])for i in range(female_number):ff = math.exp(-male_best / (female_fitness[i] + 1e-30))direction = random.choice(vec_flag)new_female[i] = female[i] + direction * c3 * ff * np.random.rand(dim) * (quantity * female_best_solution - female[i])else:# 交配模式for i in range(male_number):mm = math.exp(-female_fitness[i % female_number] / (male_fitness[i] + 1e-30))direction = random.choice(vec_flag)new_male[i] = male[i] + direction * c3 * np.random.rand() * mm * (quantity * female[i % female_number] - male[i])for i in range(female_number):mf = math.exp(-male_fitness[i % male_number] / (female_fitness[i] + 1e-30))direction = random.choice(vec_flag)new_female[i] = female[i] + direction * c3 * np.random.rand() * mf * (quantity * male[i % male_number] - female[i])if random.random() < 0.5:worst_male = np.argmax(male_fitness)new_male[worst_male] = solution_bound[0] + np.random.rand(dim) * (solution_bound[1] - solution_bound[0])worst_female = np.argmax(female_fitness)new_female[worst_female] = solution_bound[0] + np.random.rand(dim) * (solution_bound[1] - solution_bound[0])# 边界处理new_male = np.clip(new_male, solution_bound[0], solution_bound[1])new_female = np.clip(new_female, solution_bound[0], solution_bound[1])# 更新雄性种群for i in range(male_number):new_fit = chung_reynolds(new_male[i])if new_fit < male_fitness[i]:male[i] = new_male[i]male_fitness[i] = new_fit# 更新雌性种群for i in range(female_number):new_fit = chung_reynolds(new_female[i])if new_fit < female_fitness[i]:female[i] = new_female[i]female_fitness[i] = new_fit# 更新全局最优current_male_best = np.min(male_fitness)current_female_best = np.min(female_fitness)gene_best[t] = min(current_male_best, current_female_best)if current_male_best < current_female_best:if current_male_best < gy_best:gy_best = current_male_bestfood[:] = male[np.argmin(male_fitness)]else:if current_female_best < gy_best:gy_best = current_female_bestfood[:] = female[np.argmin(female_fitness)]# 模拟退火if T > T_min:food_new = neighbor(food, solution_bound)f_new = chung_reynolds(food_new)delta = f_new - gy_bestif delta < 0 or np.random.rand() < math.exp(-delta / T):food[:] = food_newgy_best = f_newT *= alphareturn food, gy_best, gene_best
if __name__ == "__main__":# Problem settingsdim = 10search_agents_no = 26bounds = (-100, 100)max_iter = 100initial_temp = 1000cooling_rate = 0.98best_solution2, best_fitness2, fitness_history2 = snake_optimization(search_agents_no, max_iter, dim, bounds)best_solution3, best_fitness3, fitness_history3 = sa_snake_optimization(search_agents_no, max_iter, dim, bounds)# Plot optimization processplt.figure(figsize=(10, 6))plt.plot(fitness_history2, linewidth=2,label='SO')plt.plot(fitness_history3, linewidth=2,label='SASO')plt.legend()plt.title("Optimization Process")plt.xlabel("Iteration")plt.ylabel("Best Fitness")plt.grid(True)plt.show()print("SO最佳解决方案:", best_solution2)print("SO最佳适应度:", best_fitness2)print("SASO最佳解决方案:", best_solution3)print("SASO最佳适应度:", best_fitness3)
SO最佳解决方案: [-7.18304079e-04  2.99050463e-04  4.11682735e-04  9.49958913e-05-3.24086231e-04  1.01366699e-03 -3.25997173e-04  1.86127080e-032.60402360e-04 -5.85704982e-04]
SO最佳适应度: 1.3505001036507069e-11
SASO最佳解决方案: [ 2.46793435e-05  1.43884017e-04  1.11257355e-04  8.70514697e-051.46319530e-05  2.40548315e-04 -3.72922538e-05 -1.02563608e-05-5.73090196e-05  2.23889093e-04]
SASO最佳适应度: 6.5132243165577145e-15

3 改进蛇优化VGG13SE的故障诊断模型

# -*- coding: utf-8 -*-
import matplotlib.pyplot as plt
import numpy as np
import math
from model import ProposedNet2D
from tensorflow.keras.losses import SparseCategoricalCrossentropy
from tensorflow.keras.optimizers import Adam,SGD
import tensorflow as tf
import math
import random
plt.rcParams['font.family'] = ['sans-serif']
plt.rcParams['font.sans-serif'] = ['SimHei']
plt.rcParams['axes.unicode_minus']=Falsedef HUATU(mode,trace):plt.figure()plt.plot(trace)plt.title('fitness curve')plt.xlabel('iteration')plt.ylabel('fitness value')plt.savefig('result/'+mode+'_cnn_fitness.png')# plt.show()
# 修正后的适应度函数
def chung_reynolds(pop,X_train,y_train,X_valid,y_valid):tf.random.set_seed(0)para = [pop[i] if i==0 else int(pop[i]) for i in range(len(pop))]print(para)learningrate=para[0]#学习率epochs = para[1]#迭代次数 batch_size = para[2]  #BATCH_SIZEk1_num,k1_size,k2_num,k2_size,k3_num,k3_size,k4_num,k4_size,k5_num,k5_size,fc1,fc2=para[3:]model= ProposedNet2D(k1_num,k1_size,k2_num,k2_size,k3_num,k3_size,k4_num,k4_size,k5_num,k5_size,fc1,fc2)#model.summary()model.compile(optimizer=Adam(learning_rate=learningrate),loss=SparseCategoricalCrossentropy(),metrics=['accuracy'])history = model.fit(X_train,y_train, epochs=epochs,validation_data=(X_valid, y_valid),batch_size=batch_size, verbose=0)return 1-history.history['val_accuracy'][-1]#以最小化验证集错误率为适应度函数def Optim(p_train,t_trian,p_valid,t_valid):search_agents_no=5max_iter=10#一共有15个参数需要优化#分别是 learningrate epoches batchsize k1num k1size k2num k2size k3num k3size k4num k4size k5num k5size fc1 fc2# lb ub是各参数的寻优上下界,如学习率是0.0001-0.01的范围内找最优解,epoches是50-100的范围内找最优解,fc1是10-200的范围内找最优解lb=[0.0001,30, 32,5 ,1,10 ,1 ,20 ,1,30,1,40,1, 10 ,10]ub=[0.01,  100,128,10,5,20, 5, 30, 5,40,5,50,5,200,100]#dim = len(lb)return SASO(search_agents_no,max_iter,dim,lb,ub,p_train,t_trian,p_valid,t_valid)'''tent映射'''
def tent(dim):x=np.zeros([dim])x[0]=np.random.rand()#初始点a=0.7 #参数a的值for i in range(dim-1):if x[i]<a:x[i+1]=x[i]/aelse:x[i+1]=(1-x[i]) / (1 - a)return x
''' Tent种群初始化函数 '''
def initialnew(pop, dim, ub, lb):X = np.zeros([pop, dim])for i in range(pop):tentvalue=tent(dim)for j in range(dim):X[i, j] = tentvalue[j]*(ub[j] - lb[j]) + lb[j]return X
# 修正后的邻域生成函数
def neighbor(x, solution_bound):perturbation = np.random.uniform(-1, 1, size=x.shape)x_new = x + perturbation# 确保扰动后仍在边界内x_new = np.clip(x_new, solution_bound[0], solution_bound[1])return x_new
'''改进的蛇算法优化'''
def SASO(search_agents_no, max_iter, dim, lower_bound,upper_bound,p_train,t_trian,p_valid,t_valid):# 参数初始化T = 1000T_min = 0.01alpha = 0.9vec_flag = [1, -1]food_threshold = 0.25temp_threshold = 0.6c1 = 0.5model_threshold = 0.6c2 = 0.5c3 = 2lower_bound, upper_bound =np.array(lower_bound),np.array(upper_bound)# 种群初始化(使用numpy数组代替矩阵)X = initialnew(search_agents_no, dim, lower_bound ,  upper_bound) #初始化种群# 适应度计算fitness = np.array([chung_reynolds(x,p_train,t_trian,p_valid,t_valid) for x in X])g_best_idx = np.argmin(fitness)food = X[g_best_idx].copy()gy_best = fitness[g_best_idx]# 性别分组male_number = search_agents_no // 2female_number = search_agents_no - male_numbermale = X[:male_number].copy()female = X[male_number:].copy()# 性别相关参数male_fitness = fitness[:male_number]female_fitness = fitness[male_number:]male_best_idx = np.argmin(male_fitness)male_best = male_fitness[male_best_idx]male_best_solution = male[male_best_idx].copy()female_best_idx = np.argmin(female_fitness)female_best = female_fitness[female_best_idx]female_best_solution = female[female_best_idx].copy()gene_best = np.zeros(max_iter)for t in range(max_iter):temp = math.exp(-t / max_iter)quantity = c1 * math.exp((t - max_iter) / max_iter)quantity = min(quantity, 1)new_male = male.copy()new_female = female.copy()if quantity < food_threshold:# 无食物模式for i in range(male_number):leader = random.choice(male)am = math.exp(-(chung_reynolds(leader,p_train,t_trian,p_valid,t_valid) / (male_fitness[i] + 1e-30)))direction = random.choice(vec_flag)new_male[i] = leader + direction * c2 * am * np.random.rand(dim) * (upper_bound - lower_bound)for i in range(female_number):leader = random.choice(female)am = math.exp(-(chung_reynolds(leader,p_train,t_trian,p_valid,t_valid) / (female_fitness[i] + 1e-30)))direction = random.choice(vec_flag)new_female[i] = leader + direction * c2 * am * np.random.rand(dim) * (upper_bound - lower_bound)else:if temp > temp_threshold:# 热态探索for i in range(male_number):direction = random.choice(vec_flag)new_male[i] = food + direction * c3 * temp * np.random.rand(dim) * (food - male[i])for i in range(female_number):direction = random.choice(vec_flag)new_female[i] = food + direction * c3 * temp * np.random.rand(dim) * (food - female[i])else:if random.random() < model_threshold:# 战斗模式for i in range(male_number):fm = math.exp(-female_best / (male_fitness[i] + 1e-30))direction = random.choice(vec_flag)new_male[i] = male[i] + direction * c3 * fm * np.random.rand(dim) * (quantity * male_best_solution - male[i])for i in range(female_number):ff = math.exp(-male_best / (female_fitness[i] + 1e-30))direction = random.choice(vec_flag)new_female[i] = female[i] + direction * c3 * ff * np.random.rand(dim) * (quantity * female_best_solution - female[i])else:# 交配模式for i in range(male_number):mm = math.exp(-female_fitness[i % female_number] / (male_fitness[i] + 1e-30))direction = random.choice(vec_flag)new_male[i] = male[i] + direction * c3 * np.random.rand() * mm * (quantity * female[i % female_number] - male[i])for i in range(female_number):mf = math.exp(-male_fitness[i % male_number] / (female_fitness[i] + 1e-30))direction = random.choice(vec_flag)new_female[i] = female[i] + direction * c3 * np.random.rand() * mf * (quantity * male[i % male_number] - female[i])if random.random() < 0.5:worst_male = np.argmax(male_fitness)new_male[worst_male] = lower_bound + np.random.rand(dim) * (upper_bound - lower_bound)worst_female = np.argmax(female_fitness)new_female[worst_female] = lower_bound + np.random.rand(dim) * (upper_bound - lower_bound)# 边界处理new_male = np.clip(new_male, lower_bound, upper_bound)new_female = np.clip(new_female, lower_bound, upper_bound)# 更新雄性种群for i in range(male_number):new_fit = chung_reynolds(new_male[i],p_train,t_trian,p_valid,t_valid)if new_fit < male_fitness[i]:male[i] = new_male[i]male_fitness[i] = new_fit# 更新雌性种群for i in range(female_number):new_fit = chung_reynolds(new_female[i],p_train,t_trian,p_valid,t_valid)if new_fit < female_fitness[i]:female[i] = new_female[i]female_fitness[i] = new_fit# 更新全局最优current_male_best = np.min(male_fitness)current_female_best = np.min(female_fitness)gene_best[t] = min(current_male_best, current_female_best)print('第',t,'轮优化完成,最优适应度值为:',gene_best[t])if current_male_best < current_female_best:if current_male_best < gy_best:gy_best = current_male_bestfood[:] = male[np.argmin(male_fitness)]else:if current_female_best < gy_best:gy_best = current_female_bestfood[:] = female[np.argmin(female_fitness)]# 模拟退火 新增部分if T > T_min:food_new = neighbor(food, [lower_bound,upper_bound])f_new = chung_reynolds(food_new,p_train,t_trian,p_valid,t_valid)delta = f_new - gy_bestif delta < 0 or np.random.rand() < math.exp(-delta / T):food[:] = food_newgy_best = f_newT *= alphareturn food, gy_best, gene_best

4 调用程序

下面程序中有两个地方设定了False,分别是优化前面和训练前面,因为优化的时间很长,所以我把结果保存了下来,后面只需要调用保存的参数即可,如果要重新优化,改成optimization_again=

True。同理如果要重新训练,则改train_again=True训练即可。

# coding: utf-8
# In[1]: 导入必要的库函数
import os
import numpy as np
import matplotlib.pyplot as plt
from sklearn.metrics import confusion_matrix 
import seaborn as sns
from model import ProposedNet2D,SE_AttentionLayer
import tensorflow as tf
from tensorflow.keras.losses import SparseCategoricalCrossentropy
from tensorflow.keras.optimizers import Adam,SGD
from util import read_directory
from optim import HUATU,Optim
import random
from tensorflow.keras.utils import plot_modelimport os
# os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
# os.environ["CUDA_VISIBLE_DEVICES"] = "0"
# In[] 加载数据
height=64
width=64# 时频图---2D-CNN输入
x_train1,y_train=read_directory('image/train',height,width,normal=1)
x_valid1,y_valid=read_directory('image/test',height,width,normal=1)# In[] 采用优化算法优化CNN超参数
mode = 'SASO' 
optimization_again = False # 为 False 就直接调用之前的优化的参数  True就重新优化
if optimization_again:best_solution, best_fitness, fitness_history = Optim(x_train1,y_train,x_valid1,y_valid)np.savez('result/'+mode+'para.npz',best_solution=best_solution,best_fitness=best_fitness,fitness_history=fitness_history)
else:data = np.load('result/'+mode+'para.npz')best_solution, best_fitness, fitness_history = data['best_solution'].reshape(-1,),data['best_fitness'],data['fitness_history'].reshape(-1,)
HUATU(mode,fitness_history)
# In[] 利用优化得到的参数进行搭建模型 
# 构建网络结构是 输入层-2d卷积-池化-Bn-SE注意力-2d卷积-池化-Bn-SE注意力-2d卷积-池化-Bn-SE注意力-全连接-输出层
# 参数设置,有点多 分别
# 是第1卷积层的卷积核数量k1_num、卷积核大小k1_size*k1_size
# 是第2卷积层的卷积核数量k2_num、卷积核大小k2_size*k2_size
# 是第3卷积层的卷积核数量k3_num、卷积核大小k3_size*k3_size
# 是第4卷积层的卷积核数量k4_num、卷积核大小k4_size*k4_size
# 是第5卷积层的卷积核数量k5_num、卷积核大小k4_size*k5_size
# 全连接层的节点数fc1,fc2
# 训练次数 epoches,batchsize,学习率 learningrate
tf.random.set_seed(0)
np.random.seed(0)
para = [best_solution[i] if i==0 else int(best_solution[i]) for i in range(len(best_solution))]
print(mode,'优化得到的超参数:',para)
learningrate=para[0]#学习率
epochs = para[1]#迭代次数 
batch_size = para[2]  #BATCH_SIZE
k1_num,k1_size,k2_num,k2_size,k3_num,k3_size,k4_num,k4_size,k5_num,k5_size,fc1,fc2=para[3:]model= ProposedNet2D(k1_num,5,k2_num,k2_size,k3_num,k3_size,k4_num,k4_size,k5_num,k5_size,fc1,fc2)
model.summary()
checkpoint = tf.keras.callbacks.ModelCheckpoint(filepath='model/'+mode+'best', monitor='val_accuracy', verbose=0, save_best_only=True, mode = 'max')model.compile(optimizer=Adam(learning_rate=learningrate),loss=SparseCategoricalCrossentropy(),metrics=['accuracy'] )
# exit()
# In[] 训练
train_again = False # 为 False 的时候就直接加载训练好的模型进行测试 True就重新训练
# 训练模型
if train_again:history = model.fit(x_train1,y_train, epochs=epochs,validation_data=(x_valid1, y_valid),batch_size=batch_size, verbose=1,callbacks= [checkpoint])model=tf.keras.models.load_model('model/'+mode+'best',custom_objects = {'SE_AttentionLayer': SE_AttentionLayer})# 画loss曲线plt.figure()plt.ylabel('MSE')plt.xlabel('Epoch')plt.plot(history.history['loss'], label='training')# plt.plot(history.history['val_loss'], label='validation')plt.title('loss curve')plt.legend()plt.savefig('result/'+mode+'model2d_loss_curve.jpg')
else:  # 加载模型model=tf.keras.models.load_model('model/'+mode+'best',custom_objects = {'SE_AttentionLayer': SE_AttentionLayer})
#test_pred = model.predict(x_valid1)
pred_labels = np.argmax(test_pred,1)
acc=np.sum(pred_labels==y_valid)/len(y_valid)
print('分类精度为:%f '%(acc*100),'%')
C1= confusion_matrix(y_valid, pred_labels)
print('混淆矩阵:')
print(C1)
xtick=[str(i) for i in range(10)]
ytick=[str(i) for i in range(10)]plt.figure()
# C2=C1/C1.sum(axis=1)
sns.heatmap(C1,fmt='g', cmap='Blues',annot=True,cbar=False,xticklabels=xtick, yticklabels=ytick)
plt.xlabel('Predict label')
plt.ylabel('True label')
plt.title('Confusion_matrix')
plt.savefig('result/'+mode+'Confusion_matrix_2d.jpg')
plt.show()  

 

5 结语

在这篇博客中,我们详细描述了优化算法的改进方式,并将蛇算法进行改进用于VGG13SE网络超参数优化,因此可以将我们的方法命名为 Bearing Fault Diagnosis Model based on Imporved snake algorithm  and IVFD nerual network(IVFD是咱们前几篇博客中对VGG13SE网络的定义 Imporved VGG fault diagnosis Model)故障诊断模型(简称,ISO-IVFDNet)。这篇结束后,我们就做完了数据预处理与特征提取、故障诊断模型搭建、故障诊断模型超参数优化、改进的算法用于故障诊断模型超参数优化。离完整的论文只差最后一部分,验证所提方法有效性,此部分内容将在下一篇博客中简要概述。

获取更多内容请点击【专栏】,您的点赞与收藏是我持续更新【Python神经网络1000个案例分析】的动力。


http://www.mrgr.cn/news/96855.html

相关文章:

  • VMware上的windows虚拟机安装使用Docker方法
  • 3D 地图渲染-区域纹理图添加
  • C++中的继承
  • 推导Bias² + Variance + σ²_ε
  • 【11408学习记录】从混乱到清晰:还原+断开+简化,彻底攻破英语分裂式长难句
  • Spring Boot 工程创建详解
  • arcgis10.8 Toolbox中没有找到conversion tools模块
  • GitHub 趋势日报 (2025年04月01日)
  • Kubernetes 入门篇之 Node 安装与部署
  • Windows 实战-evtx 文件分析--做题笔记
  • Pycharm(十二)列表练习题
  • 视图函数的应用
  • SuperMap GIS基础产品FAQ集锦(20250402)
  • .Net8项目使用docker、docker-compose部署步骤
  • 3、nFR52xx蓝牙学习(点亮第一个LED灯)
  • 巧用临时对象之五
  • element-ui自制树形穿梭框
  • C++ 编程指南33 - 使用模板来表达适用于多种参数类型的算法
  • 基于React + Antd + Java的OFD文件上传预览实现方案(OFD文件转图片)
  • 对象和面向对象三大特征:封装