设为首页 加入收藏

TOP

Python TensorFlow深度神经网络回归:keras.Sequential(五)
2023-07-25 21:26:18 】 浏览:108
Tags:Python TensorFlow 经网络 keras.Sequential
the last run. DeleteOldModel(ModelPath) # Find and save optimal epochs. CallBack=CheckPoint(CheckPointName) # Build DNN regression model. DNNModel=BuildModel(Normalizer) DNNModel.summary() DNNHistory=DNNModel.fit(TrainX, TrainY, epochs=FitEpoch, # batch_size=BatchSize, verbose=1, callbacks=CallBack, validation_split=ValFrac) # Draw error image. LossPlot(DNNHistory) # Optimize the model based on optimal epoch. DNNModel=BestEpochIntoModel(CheckPointPath,DNNModel) # Predict test set data. TestPrediction=DNNModel.predict(TestX).flatten() # Draw Test image. TestPlot(TestY,TestPrediction) # Verify the accuracy and draw error hist image. AccuracyResult=AccuracyVerification(TestY,TestPrediction) PearsonR,R2,RMSE=AccuracyResult[0],AccuracyResult[1],AccuracyResult[2] # Save model and key parameters. DNNModel.save(ModelPath) WriteAccuracy(ParameterPath,PearsonR,R2,RMSE,TrainFrac,RandomSeed,CheckPointMethod, ','.join('%s' %i for i in HiddenLayer),RegularizationFactor, ActivationMethod,','.join('%s' %i for i in DropoutValue),OutputLayerActMethod, LossMethod,LearnRate,LearnDecay,FitEpoch,BatchSize,ValFrac,BestEpochOptMethod)

??至此,大功告成。

首页 上一页 2 3 4 5 6 7 下一页 尾页 5/7/7
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇Python工具箱系列(十七) 下一篇flask,uwsgi,nginx部署配置

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目