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

设计型网站建设怀来县住房和城乡规划建设局网站

设计型网站建设,怀来县住房和城乡规划建设局网站,phpcmsv9 网站搬家,课件ppt免费下载诸神缄默不语-个人CSDN博文目录 fitlog包是用于自动版本管理和自动日志记录的Python包#xff0c;是fastNLP团队开发的。 fitlog 中文文档 — fitlog 文档 我下载的是fitlog 0.9.15版本。 他们团队的文档写的真的不行#xff0c;崩溃#xff0c;FastNLP也很难用#xff0…诸神缄默不语-个人CSDN博文目录 fitlog包是用于自动版本管理和自动日志记录的Python包是fastNLP团队开发的。 fitlog 中文文档 — fitlog 文档 我下载的是fitlog 0.9.15版本。 他们团队的文档写的真的不行崩溃FastNLP也很难用fitlog也很难用中文读起来比transformers和wandb的英文很难懂。 最近更新时间2023.4.24 最早更新时间2023.4.23 文章目录 1. 安装2. 快速上手3. 命令行工具4. 环境变量5. 配置文件6. 常见问题7. fitlog API 1. 安装 直接pip install fitlog 2. 快速上手 fitlog init example输出 会在当前目录下创建example文件夹。其中logs 文件夹是 fitlog 默认存放日志的文件夹main.py 是训练程序的入口文件。 将main.py修改为训练代码 import fitlog import random import argparse# 从命令行传入参数 parser argparse.ArgumentParser() parser.add_argument(--demo, typeint, default2)# fitlog.commit(__file__) # 自动 commit 你的代码 fitlog.set_log_dir(logs/) # 设定日志存储的目录args parser.parse_args() fitlog.add_hyper(args) # 通过这种方式记录ArgumentParser的参数 fitlog.add_hyper_in_file(__file__) # 记录本文件中写死的超参数######hyper rand_seed 123 ######hyperrandom.seed(rand_seed) best_acc, best_step, step 0, 0, 0for i in range(200):step 1if step % 20 0:loss random.random()acc random.random()fitlog.add_loss(loss,nameLoss,stepstep)fitlog.add_metric({dev:{Acc:acc}}, stepstep)if accbest_acc:best_acc accfitlog.add_best_metric({dev:{Acc:best_acc}})# 当dev取得更好的performance就在test上evaluate一下test_acc random.random()fitlog.add_best_metric({test:{Acc:test_acc}}) fitlog.finish() # finish the logging把工作目录切换到example文件夹下更换代码中的rand_seed为124/123分别运行一次然后用fitlog log logs命令行打开网页我用的是VSCode所以这个IP地址是自动映射到本地的 trend: folder: 3. 命令行工具 Usage:fitlog command [args...]fitlog help commandfitlog -h | --helpfitlog --versionSupported commandsinit Initialize a fitlog projectlist List committed versionsrevert Revert to a specific versionlog Visualize logs by a serverSee fitlog help command for more information on a specific commandinit初始化项目 可以指定项目名称 name 或者默认把当前文件夹变成 fitlog 项目给了–hide选项来隐藏.fitconfig 文件–with-git创建 fitlog 时创建常规的 git Usage:fitlog init [name] [--hide] [--with-git]fitlog -h | --helpArguments:name Name of the fitlog projectOptions:-h --help This is a command to initialize a fitlog project--hide Hide .fitconfig inside .fitlog folder--with-git Initialize fitlog with a standard gitExamples:fitlog init project Create a your project named projectfitlog init Init the current directory with fitloglist查看已有记录revert版本回退 以上两项都被建议使用fitlog 提供的网页服务来完成但是网页服务相关文档还没有写。 Usage:fitlog list [num] [--show-now]fitlog revert fit_id [path] [--id-suffix]Arguments:num The number of recent commits you want to listfit_id The id of the commit you want to revertpath The path to revert the old commit versionOptions:--show-now Show the current version--id-suffix Use commit id as the suffix of reverted folderlog启动日志网页 参数 log-dir 表示日志存放的位置set_log_dir指定的logs文件夹的位置配置文件的名称网页对应的端口号服务器停止的时间 Usage:fitlog log log-dir [--log-config-nameL] [--portP] [--standby-hoursS] [--tokenT] [--ipI]Arguments:log-dir Where to find logs.Options:-h --help This is a command to start fitlog server to visualize logs.-lL --log-config-name Log server config name. Must under the folder of log-dir. [default: default.cfg]-pP --port Which port to start to looking for usable port.[default: 5000]-sS --standby-hours How long to wait before the server . [default: 48]-tT --token If this is used, your have to specify the token when accessing. Default no token.-iI --ip Which ip to bind to. Default is 0.0.0.0 [default: 0.0.0.0]4. 环境变量 在新版的 fitlog 中用户可以在运行程序前使用环境变量 FITLOG_FLAG 影响 fitlog 的作用。 注意该环境变量发生作用的时刻在于 fitlog 被 import 的瞬间之后再改变环境变量不影响 fitlog 的作用。 环境变量 FITLOG_FLAG 有三种值: DEBUG , NO_COMMIT 和其它包括为空。 当 FITLOG_FLAGDEBUG 时程序中对 fitlog 的所有调用都不起作用。你也可以在代码中使用 fitlog.debug() 产生类似的效果。 当 FITLOG_FLAGNO_COMMIT 时程序中使用 fitlog 记录数据的调用正常但 fitlog.commit() 失效。你可以在同时运行多个实验时只进行一次自动 commit。 当 FITLOG_FLAG 为空或等于其它值时不产生额外的效果。 5. 配置文件 待补 6. 常见问题 原文档中就写了的 如果在debug阶段不希望fitlog发生任何作用那么直接在入口代码处加入fitlog.debug() 就可以让所有的fitlog调用不起任何作用debug结束再注释掉这一行就可以了。 fitlog 默认只有在产生了第一个metric或loss的时候才会创建log文件夹防止因为其它bug还没运行 到model就崩溃产生大量无意义的log。 如果使用了分布式训练一般只需要主进程记录fitlog就好。这个时候可以通过将非主进程的fitlog设置fitlog.debug() import torch import fitlogif torch.distributed.get_rank()0:fitlog.debug()不要通过多进程使用fitlog即multiprocessing模块。 fitlog.commit()只需要在某个python文件调用就可以了一般就在入口python文件即可。 传入到fitlog的各种参数、metric的名称请 避免特殊符号例如$%!#空格请只使用_与各种字母的组合 因为特殊符号可能导致网页端显示不正常。 7. fitlog API 未完待续。 set_log_dir(log_dir: str, new_log: bool False)设定 log 文件夹的路径add_metric(value: Union[int, str, float, dict], step: int, name: str None, epoch: int None)用于添加 metric 。用此方法添加的值不会显示在表格中但可以在单次训练的详情曲线图中查看。add_loss(value: Union[int, str, float, dict], step: int, name: str None, epoch: int None)用于添加 loss。用此方法添加的值不会显示在表格中但可以在单次训练的详情曲线图中查看。add_best_metric(value: Union[int, str, float, dict], name: str None)用于添加最好的 metric 。用此方法添加的值会被显示在表格中的 metric 列及其子列中。相同key的内容将只保留最后一次传入的值。add_hyper(value: Union[int, str, float, dict, argparse.Namespace, configparser.ConfigParser], nameNone)用于添加超参数。用此方法添加到值会被放置在表格中的 hyper 列及其子列中add_hyper_in_file(file_path: str None) 从文件读取参数。如下面的文件所示两行”#####hyper”(至少5个#)之间的参数会被读取出来并组成一个字典。每个变量最多只能出现在一行中 如果多次出现只会记录第一次出现的值。demo.py: from numpy as np import fitlog # do somethingfitlog.add_hyper_in_file(__file__) # 会把本python文件的hyper加入进去 ############hyper lr 0.01 # some comments char_embed word_embed 300hidden_size 100 .... ############hyper# do something model Model(xxx)相当于转换为如下字典并添加到入参中 {lr: 0.01,char_embed: 300word_embed: 300hidden_size: 100 }finish(status: int 0, send_to_bot: str None)使用此方法告知 fitlog 你的实验已经正确结束。你可以使用此方法来筛选出失败的实验。
http://www.tj-hxxt.cn/news/137726.html

相关文章:

  • 招远市建设局网站宁波网站设计价格
  • 怎么做捕鱼网站制作服务网站
  • 要实现对网站中的所有内容进行搜索代码应该怎么写公司网站建设管理
  • 网站开发结语网站建设资料准备标准
  • 网站开发环境安装程序360如何做网站优化
  • 网站两侧广告做网站的表情包
  • 怎么做直播网站刷弹幕wordpress创建相册
  • 百度浏览器官方网站市场营销八大营销模式
  • 代做ppt网站制作网页类型一般分为什么
  • 网站公司seo个人网站怎么快速推广
  • 免费自助建站平台系统wordpress面页模板下
  • 网站建设 技术支持一二三四在线观看免费中文动漫版
  • 腾讯云网站模板深圳注册公司地址新规定
  • 网站建设实力宣传海报7c框架 网站建设
  • 网站开发关联下拉列表企业展示网站模板
  • 文章类型的网站模版网站如何做优化排名
  • 深圳网站开发公司 有哪些wordpress主题微信验证码
  • 网站的备案流程怎么恢复网站数据库文件位置
  • 怎么上不到建设银行网站怎样用电脑ip做网站
  • 海淀网站建设怎么样最好用的搜索引擎
  • 网站建设项目的费用做什么科目淮安网站建设要多少钱
  • 安徽住房与城乡建设部网站建设公司网站的原则
  • 超轻粘土做动漫网站做架构图简单的网站
  • 抖音免费推广网站百度门店推广
  • 中国施工总承包100强北京seo优化排名
  • 音乐网站程序源码海南省住房和城乡建设厅网站
  • 网站建设江阴店面设计的重要性
  • 电脑可以做网站主机么学风建设网站
  • 网站服务费算什么费用杭州萧山网站建设公司
  • 厦门市建设局官方网站证书查询pc建站网站