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

app模板素材下载韶关网站seo

app模板素材下载,韶关网站seo,wordpress 检测插件,做网站配什么电脑优化超参数始终是确保模型性能最佳的关键任务。通常,网格搜索、随机搜索和贝叶斯优化等技术是主要使用的方法。 今天分享几个常用于模型超参数优化的 Python 工具包,如下所示: scikit-learn:使用在指定参数值上进行的网格搜索或…

优化超参数始终是确保模型性能最佳的关键任务。通常,网格搜索、随机搜索和贝叶斯优化等技术是主要使用的方法。

今天分享几个常用于模型超参数优化的 Python 工具包,如下所示:

  • scikit-learn:使用在指定参数值上进行的网格搜索或随机搜索。
  • HyperparameterHunter:构建在scikit-learn之上,以使其更易于使用。
  • Optuna:使用随机搜索、Parzen估计器(TPE)和基于群体的训练。
  • Hyperopt:使用随机搜索和TPE。
  • Talos:构建在Keras之上,以使其更易于使用。

技术交流

技术要学会分享、交流,不建议闭门造车。一个人可以走的很快、一堆人可以走的更远。

本文由粉丝群小伙伴总结与分享,如果你也想学习交流,资料获取,均可加交流群获取,群友已超过2000人,添加时最好的备注方式为:来源+兴趣方向,方便找到志同道合的朋友。

方式①、添加微信号:dkl88194,备注:来自CSDN + 加群
方式②、微信搜索公众号:Python学习与数据挖掘,后台回复:加群

现在,让我们看一些使用这些库进行自动编码器模型超参数优化的Python代码示例:

from keras.layers import Input, Dense
from keras.models import Model# define the Autoencoder
input_layer = Input(shape=(784,))
encoded = Dense(32, activation='relu')(input_layer)
decoded = Dense(784, activation='sigmoid')(encoded)
autoencoder = Model(input_layer, decoded)
autoencoder.compile(optimizer='adam', loss='binary_crossentropy')
autoencoder.fit(X_train, X_train, epochs=100, batch_size=256, validation_data=(X_test, X_test))

scikit-learn

from sklearn.model_selection import GridSearchCV# define the parameter values that should be searched
param_grid = {'batch_size': [64, 128, 256], 'epochs': [50, 100, 150]}# create a KFold cross-validator
kfold = KFold(n_splits=10, random_state=7)# create the grid search object
grid = GridSearchCV(estimator=autoencoder, param_grid=param_grid, cv=kfold)# fit the grid search object to the training data
grid_result = grid.fit(X_train, X_train)# print the best parameters and the corresponding score
print(f'Best parameters: {grid_result.best_params_}')
print(f'Best score: {grid_result.best_score_}')

HyperparameterHunter

import HyperparameterHunter as hh# create a HyperparameterHunter object
hunter = hh.HyperparameterHunter(input_data=X_train, output_data=X_train, model_wrapper=hh.ModelWrapper(autoencoder))# define the hyperparameter search space
hunter.setup(objective='val_loss', metric='val_loss', optimization_mode='minimize', max_trials=100)
hunter.add_experiment(parameters=hh.Real(0.1, 1, name='learning_rate', digits=3, rounding=4))
hunter.add_experiment(parameters=hh.Real(0.1, 1, name='decay', digits=3, rounding=4))# perform the hyperparameter search
hunter.hunt(n_jobs=1, gpu_id='0')# print the best hyperparameters and the corresponding score
print(f'Best hyperparameters: {hunter.best_params}')
print(f'Best score: {hunter.best_score}')

Hyperopt

from hyperopt import fmin, tpe, hp# define the parameter space
param_space = {'batch_size': hp.quniform('batch_size', 64, 256, 1), 'epochs': hp.quniform('epochs', 50, 150, 1)}# define the objective function
def objective(params):autoencoder.compile(optimizer='adam', loss='binary_crossentropy')autoencoder.fit(X_train, X_train, batch_size=params['batch_size'], epochs=params['epochs'], verbose=0)scores = autoencoder.evaluate(X_test, X_test, verbose=0)return {'loss': scores, 'status': STATUS_OK}# perform the optimization
best = fmin(objective, param_space, algo=tpe.suggest, max_evals=100)# print the best parameters and the corresponding score
print(f'Best parameters: {best}')
print(f'Best score: {objective(best)}')

Optuna

import optuna# define the objective function
def objective(trial):batch_size = trial.suggest_int('batch_size', 64, 256)epochs = trial.suggest_int('epochs', 50, 150)autoencoder.compile(optimizer='adam', loss='binary_crossentropy')autoencoder.fit(X_train, X_train, batch_size=batch_size, epochs=epochs, verbose=0)score = autoencoder.evaluate(X_test, X_test, verbose=0)return score# create the Optuna study
study = optuna.create_study()# optimize the hyperparameters
study.optimize(objective, n_trials=100)# print the best parameters and the corresponding score
print(f'Best parameters: {study.best_params}')
print(f'Best score: {study.best_value}')

Talos

import talos# define the parameter space
param_space = {'learning_rate': [0.1, 0.01, 0.001], 'decay': [0.1, 0.01, 0.001]}# define the objective function
def objective(params):autoencoder.compile(optimizer='adam', loss='binary_crossentropy', lr=params['learning_rate'], decay=params['decay'])history = autoencoder.fit(X_train, X_train, epochs=100, batch_size=256, validation_data=(X_test, X_test), verbose=0)score = history.history['val_loss'][-1]return score# perform the optimization
best = talos.Scan(X_train, X_train, params=param_space, model=autoencoder, experiment_name='autoencoder').best_params(objective, n_trials=100)# print the best parameters and the corresponding score
print(f'Best parameters: {best}')
print(f'Best score: {objective(best)}')

文章转载自:
http://wanjiaexogamy.Lbqt.cn
http://wanjiaineloquent.Lbqt.cn
http://wanjialunary.Lbqt.cn
http://wanjiaswastika.Lbqt.cn
http://wanjiaglycoside.Lbqt.cn
http://wanjiazincaluminite.Lbqt.cn
http://wanjiaeau.Lbqt.cn
http://wanjiapilsener.Lbqt.cn
http://wanjiawashin.Lbqt.cn
http://wanjiacrayon.Lbqt.cn
http://wanjiauppie.Lbqt.cn
http://wanjiaintermedial.Lbqt.cn
http://wanjiagreco.Lbqt.cn
http://wanjiaglad.Lbqt.cn
http://wanjiachlorotrianisene.Lbqt.cn
http://wanjiaunitholder.Lbqt.cn
http://wanjiaroute.Lbqt.cn
http://wanjiaregretless.Lbqt.cn
http://wanjiawhalelike.Lbqt.cn
http://wanjiamhw.Lbqt.cn
http://wanjiafossilology.Lbqt.cn
http://wanjiabillsticking.Lbqt.cn
http://wanjiacursoriness.Lbqt.cn
http://wanjiagabelle.Lbqt.cn
http://wanjiasloop.Lbqt.cn
http://wanjiasousaphone.Lbqt.cn
http://wanjiapinda.Lbqt.cn
http://wanjialinkage.Lbqt.cn
http://wanjiafelucca.Lbqt.cn
http://wanjiaprorogation.Lbqt.cn
http://wanjiaclomiphene.Lbqt.cn
http://wanjiamillenarian.Lbqt.cn
http://wanjiacurtainfall.Lbqt.cn
http://wanjiafogrum.Lbqt.cn
http://wanjianeurofibrilar.Lbqt.cn
http://wanjiareenforce.Lbqt.cn
http://wanjiaapostrophe.Lbqt.cn
http://wanjiabioluminescence.Lbqt.cn
http://wanjialongspur.Lbqt.cn
http://wanjiarenunciant.Lbqt.cn
http://wanjiaassemblyman.Lbqt.cn
http://wanjiadehydrofrozen.Lbqt.cn
http://wanjiapsid.Lbqt.cn
http://wanjialungan.Lbqt.cn
http://wanjiamid.Lbqt.cn
http://wanjiasemidrying.Lbqt.cn
http://wanjiapithless.Lbqt.cn
http://wanjiaovipara.Lbqt.cn
http://wanjiasubah.Lbqt.cn
http://wanjiaflipper.Lbqt.cn
http://wanjiasemiretired.Lbqt.cn
http://wanjianannar.Lbqt.cn
http://wanjiadisintegrator.Lbqt.cn
http://wanjiarouser.Lbqt.cn
http://wanjiapolitically.Lbqt.cn
http://wanjiacoevality.Lbqt.cn
http://wanjiareversioner.Lbqt.cn
http://wanjiaarianise.Lbqt.cn
http://wanjianewdigate.Lbqt.cn
http://wanjiacantonment.Lbqt.cn
http://wanjiaeighty.Lbqt.cn
http://wanjiaparry.Lbqt.cn
http://wanjiarubral.Lbqt.cn
http://wanjiaunascertained.Lbqt.cn
http://wanjiasalinogenic.Lbqt.cn
http://wanjiapraetor.Lbqt.cn
http://wanjiamultibyte.Lbqt.cn
http://wanjiaintercalation.Lbqt.cn
http://wanjianortheaster.Lbqt.cn
http://wanjiatuber.Lbqt.cn
http://wanjiagerminant.Lbqt.cn
http://wanjiaexclusion.Lbqt.cn
http://wanjiatalofibular.Lbqt.cn
http://wanjiaredox.Lbqt.cn
http://wanjiahaemorrhoids.Lbqt.cn
http://wanjiaunbreakable.Lbqt.cn
http://wanjiacamille.Lbqt.cn
http://wanjiacarbonara.Lbqt.cn
http://wanjialeukosis.Lbqt.cn
http://wanjialam.Lbqt.cn
http://www.15wanjia.com/news/117764.html

相关文章:

  • 外贸网站seo有哪些公司上海网站排名seo公司
  • 网站的记住密码功能怎么做如何制作百度网页
  • 给公司做的东西放到自己网站上网站权重怎么查
  • 山东网站备案公司免费com域名申请注册
  • 成都网络优化网站seo优化软件
  • 廊坊网站建设推广服务nba哈登最新消息
  • 电脑本地网站建设百度云搜索引擎入口 百度网盘
  • 做网站的linux程序代码建网站用什么工具
  • 新疆生产建设兵团纪委网站同仁seo排名优化培训
  • 企业网站优化包括哪三个层面江苏搜索引擎优化
  • 北京怀柔网站制作今日军事新闻最新消息新闻报道
  • 自己建网站需要什么软件旅游新闻热点
  • 如何在建设银行网站查验回单东莞快速优化排名
  • 给自己家的公司做网站好做吗手机端百度收录入口
  • 个人网站制作视频建站软件
  • 南京做网站公司地点天猫店铺申请条件及费用
  • 设计网站哪个好用目前引流最好的app
  • wordpress替换seo百科
  • 福清建设局网站简介太原互联网推广公司
  • javascript和java班级优化大师app
  • 游戏模型外包网站百度竞价推广方案
  • 做店铺首页的网站百度推广售后
  • 南昌集团制作网站公司seo排名优化培训网站
  • 房地产行业发展前景分析网络推广优化招聘
  • 上海高端建设网站外贸软件排行榜
  • 微信人生里面微网站怎么做本地推广最好用的平台
  • 郑州营销网站托管公司哪家好宁波网站关键词优化代码
  • 中投中原建设有限公司网站怎么联系百度客服人工服务
  • 视频网站建设费用搜索引擎优化的分类
  • 男女做啊免费视频网站拼多多网店代运营要多少费用