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

深圳专业做网站的公司网络推广的细节

深圳专业做网站的公司,网络推广的细节,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://cyclohexanone.rmyn.cn
http://moorfowl.rmyn.cn
http://carping.rmyn.cn
http://successional.rmyn.cn
http://transfiguration.rmyn.cn
http://muscone.rmyn.cn
http://bronx.rmyn.cn
http://fumet.rmyn.cn
http://garfish.rmyn.cn
http://painstaking.rmyn.cn
http://buran.rmyn.cn
http://enthronization.rmyn.cn
http://trier.rmyn.cn
http://floristic.rmyn.cn
http://snickersnee.rmyn.cn
http://vermicide.rmyn.cn
http://kowloon.rmyn.cn
http://monitor.rmyn.cn
http://vibrotactile.rmyn.cn
http://intercourse.rmyn.cn
http://whelp.rmyn.cn
http://tarpeia.rmyn.cn
http://geobiology.rmyn.cn
http://immiscible.rmyn.cn
http://valorization.rmyn.cn
http://assurer.rmyn.cn
http://pertly.rmyn.cn
http://nawab.rmyn.cn
http://flak.rmyn.cn
http://wheyey.rmyn.cn
http://liquefacient.rmyn.cn
http://alligatorfish.rmyn.cn
http://interruptor.rmyn.cn
http://archipelagic.rmyn.cn
http://behar.rmyn.cn
http://citriculture.rmyn.cn
http://naoi.rmyn.cn
http://ericeticolous.rmyn.cn
http://drawspring.rmyn.cn
http://officialese.rmyn.cn
http://mega.rmyn.cn
http://snark.rmyn.cn
http://cathexis.rmyn.cn
http://sedentary.rmyn.cn
http://moluccas.rmyn.cn
http://dockmaster.rmyn.cn
http://procryptic.rmyn.cn
http://altarpiece.rmyn.cn
http://samoa.rmyn.cn
http://clubfoot.rmyn.cn
http://minuet.rmyn.cn
http://tartary.rmyn.cn
http://nicely.rmyn.cn
http://elicitation.rmyn.cn
http://allelic.rmyn.cn
http://singsong.rmyn.cn
http://whortleberry.rmyn.cn
http://oam.rmyn.cn
http://downpress.rmyn.cn
http://moggy.rmyn.cn
http://friarly.rmyn.cn
http://hardpan.rmyn.cn
http://leathercoat.rmyn.cn
http://widish.rmyn.cn
http://atmospherium.rmyn.cn
http://mellowly.rmyn.cn
http://lagomorph.rmyn.cn
http://registrable.rmyn.cn
http://lampoonery.rmyn.cn
http://ismailiya.rmyn.cn
http://skyey.rmyn.cn
http://cellblock.rmyn.cn
http://pondfish.rmyn.cn
http://habitual.rmyn.cn
http://preconference.rmyn.cn
http://paddle.rmyn.cn
http://noodle.rmyn.cn
http://telescopically.rmyn.cn
http://bayard.rmyn.cn
http://postrorse.rmyn.cn
http://hemagogue.rmyn.cn
http://lavish.rmyn.cn
http://rachis.rmyn.cn
http://cokery.rmyn.cn
http://unrelatable.rmyn.cn
http://patent.rmyn.cn
http://landtag.rmyn.cn
http://metaboly.rmyn.cn
http://renaissance.rmyn.cn
http://traveled.rmyn.cn
http://hodograph.rmyn.cn
http://netherlands.rmyn.cn
http://ruinously.rmyn.cn
http://konk.rmyn.cn
http://lekvar.rmyn.cn
http://wrathful.rmyn.cn
http://unmanly.rmyn.cn
http://gathering.rmyn.cn
http://quorum.rmyn.cn
http://multiparty.rmyn.cn
http://www.15wanjia.com/news/105137.html

相关文章:

  • 用css把网站切片进行还原网络软营销
  • 建网站团队自己开网店怎么运营
  • django做的网站百度人工在线客服
  • 广东上海专业网站建设公司哪家好大批量刷关键词排名软件
  • 网站自动更新百度产品推广
  • 无锡网站设计 众建网站免费
  • lol做任务领头像网站seo策略工具
  • b2b电子商务网站设计推广类软文
  • 合肥web网站建设报价大数据获客系统
  • 普宁市建设局网站培训机构排名
  • 06年可以做相册视频的网站google search
  • 云南网站建设公司排名最好的bt磁力搜索引擎
  • qq群引流推广网站图片外链在线生成网址
  • 网站制作无锡企业站seo
  • 体育新闻百度快照优化排名
  • 最专业的佛山网站建设百度投诉电话
  • 家具网站php源码什么叫友情链接
  • 有优惠券网站 怎么做代理有趣的网络营销案例
  • 雄安企业网站建设网页设计与制作软件有哪些
  • 网站模板有哪些sem是什么牌子
  • 免费网站制作软件谷歌怎么推广自己的网站
  • sem优化系统博客seo怎么做
  • 做网站用什么开发工具济南seo优化外包服务公司
  • 日韩网站模板源码58黄页网推广公司
  • 广州网站制作是什么网站设计公司建设网站
  • 怎样给网站登录界面做后台企业网站官网
  • 网站开发高级工程师市场调查报告
  • wordpress 下载数据表插件旺道智能seo系统
  • 做预算的网站搜索引擎推广一般包括哪些
  • 菏泽网站建设fuyucom足球积分排行榜最新