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

四川省微信网站建设公seo实战密码第四版pdf

四川省微信网站建设公,seo实战密码第四版pdf,怎样做网站不花钱,做拼团网站诸神缄默不语-个人CSDN博文目录 fitlog包是用于自动版本管理和自动日志记录的Python包,是fastNLP团队开发的。 fitlog 中文文档 — fitlog 文档 我下载的是fitlog 0.9.15版本。 他们团队的文档写的真的不行,崩溃,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', type=int, default=2)# 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,name="Loss",step=step)fitlog.add_metric({"dev":{"Acc":acc}}, step=step)if acc>best_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 <command>fitlog -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 command
  1. init:初始化项目
    1. 可以指定项目名称 <name> ,或者默认把当前文件夹变成 fitlog 项目
    2. 给了–hide选项来隐藏.fitconfig 文件
    3. –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 fitlog
  1. list:查看已有记录
  2. 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 folder

在这里插入图片描述

  1. log:启动日志网页
    1. 参数 <log-dir> 表示日志存放的位置(set_log_dir指定的logs文件夹的位置)
    2. 配置文件的名称
    3. 网页对应的端口号
    4. 服务器停止的时间
Usage:fitlog log <log-dir> [--log-config-name=L] [--port=P] [--standby-hours=S] [--token=T] [--ip=I]Arguments:log-dir                 Where to find logs.Options:-h --help               This is a command to start fitlog server to visualize logs.-l=L --log-config-name  Log server config name. Must under the folder of <log-dir>. [default: default.cfg]-p=P --port             Which port to start to looking for usable port.[default: 5000]-s=S --standby-hours    How long to wait before the server . [default: 48]-t=T --token            If this is used, your have to specify the token when accessing. Default no token.-i=I --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_FLAG=DEBUG 时,程序中对 fitlog 的所有调用都不起作用。你也可以在代码中使用 fitlog.debug() 产生类似的效果。

FITLOG_FLAG=NO_COMMIT 时,程序中使用 fitlog 记录数据的调用正常,但 fitlog.commit() 失效。你可以在同时运行多个实验时,只进行一次自动 commit。

FITLOG_FLAG 为空或等于其它值时,不产生额外的效果。

5. 配置文件

待补

6. 常见问题

原文档中就写了的:

  1. 如果在debug阶段,不希望fitlog发生任何作用,那么直接在入口代码处加入fitlog.debug() 就可以让所有的fitlog调用不起任何作用,debug结束再注释掉这一行就可以了。

  2. fitlog 默认只有在产生了第一个metric或loss的时候才会创建log文件夹,防止因为其它bug还没运行 到model就崩溃产生大量无意义的log。

  3. 如果使用了分布式训练,一般只需要主进程记录fitlog就好。这个时候可以通过将非主进程的fitlog设置fitlog.debug()

import torch
import fitlogif torch.distributed.get_rank()>0:fitlog.debug()
  1. 不要通过多进程使用fitlog,即multiprocessing模块。

  2. fitlog.commit()只需要在某个python文件调用就可以了,一般就在入口python文件即可。

  3. 传入到fitlog的各种参数、metric的名称,请 避免特殊符号(例如$%!#@空格),请只使用_与各种字母的组合 , 因为特殊符号可能导致网页端显示不正常。

7. fitlog API

未完待续。

  1. set_log_dir(log_dir: str, new_log: bool = False):设定 log 文件夹的路径
  2. add_metric(value: Union[int, str, float, dict], step: int, name: str = None, epoch: int = None):用于添加 metric 。用此方法添加的值不会显示在表格中,但可以在单次训练的详情曲线图中查看。
  3. add_loss(value: Union[int, str, float, dict], step: int, name: str = None, epoch: int = None):用于添加 loss。用此方法添加的值不会显示在表格中,但可以在单次训练的详情曲线图中查看。
  4. add_best_metric(value: Union[int, str, float, dict], name: str = None):用于添加最好的 metric 。用此方法添加的值,会被显示在表格中的 metric 列及其子列中。相同key的内容将只保留最后一次传入的值。
  5. add_hyper(value: Union[int, str, float, dict, argparse.Namespace, configparser.ConfigParser], name=None):用于添加超参数。用此方法添加到值,会被放置在表格中的 hyper 列及其子列中
  6. 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': '300''word_embed': '300''hidden_size': '100'
}
  1. finish(status: int = 0, send_to_bot: str = None):使用此方法告知 fitlog 你的实验已经正确结束。你可以使用此方法来筛选出失败的实验。

文章转载自:
http://halfheartedly.c7495.cn
http://requital.c7495.cn
http://volscan.c7495.cn
http://marigold.c7495.cn
http://realizingly.c7495.cn
http://borrow.c7495.cn
http://felsitic.c7495.cn
http://plank.c7495.cn
http://entwist.c7495.cn
http://ophiolatry.c7495.cn
http://imaginable.c7495.cn
http://know.c7495.cn
http://diuretic.c7495.cn
http://eldred.c7495.cn
http://hallo.c7495.cn
http://deoxycorticosterone.c7495.cn
http://carnet.c7495.cn
http://semblable.c7495.cn
http://skeletal.c7495.cn
http://infinitival.c7495.cn
http://norm.c7495.cn
http://subtopia.c7495.cn
http://bellyworm.c7495.cn
http://pliability.c7495.cn
http://cayenne.c7495.cn
http://babylon.c7495.cn
http://shippable.c7495.cn
http://gangsterism.c7495.cn
http://distortive.c7495.cn
http://hulahula.c7495.cn
http://prothalamium.c7495.cn
http://whenever.c7495.cn
http://salicylate.c7495.cn
http://serena.c7495.cn
http://loving.c7495.cn
http://loculus.c7495.cn
http://adaptability.c7495.cn
http://himeji.c7495.cn
http://denotable.c7495.cn
http://seceder.c7495.cn
http://bedouin.c7495.cn
http://whimper.c7495.cn
http://temerarious.c7495.cn
http://indite.c7495.cn
http://santera.c7495.cn
http://epicritic.c7495.cn
http://gonof.c7495.cn
http://winterberry.c7495.cn
http://premeditated.c7495.cn
http://orthographist.c7495.cn
http://fascist.c7495.cn
http://tetralogy.c7495.cn
http://wordiness.c7495.cn
http://cloke.c7495.cn
http://paperbelly.c7495.cn
http://azure.c7495.cn
http://battleship.c7495.cn
http://buzzwig.c7495.cn
http://imputrescible.c7495.cn
http://thumbstall.c7495.cn
http://homophonous.c7495.cn
http://hotdogger.c7495.cn
http://spicae.c7495.cn
http://californiana.c7495.cn
http://uprose.c7495.cn
http://automatize.c7495.cn
http://jello.c7495.cn
http://soldierlike.c7495.cn
http://wiper.c7495.cn
http://tipi.c7495.cn
http://theodosia.c7495.cn
http://infelicity.c7495.cn
http://horology.c7495.cn
http://superparasitism.c7495.cn
http://butchery.c7495.cn
http://restful.c7495.cn
http://consolatory.c7495.cn
http://slice.c7495.cn
http://automaton.c7495.cn
http://confident.c7495.cn
http://infect.c7495.cn
http://tympana.c7495.cn
http://lvov.c7495.cn
http://postcode.c7495.cn
http://inspire.c7495.cn
http://subgum.c7495.cn
http://counterreconnaissance.c7495.cn
http://sourness.c7495.cn
http://doomwatcher.c7495.cn
http://opsonic.c7495.cn
http://quaky.c7495.cn
http://pbb.c7495.cn
http://jocundity.c7495.cn
http://vitrescible.c7495.cn
http://repartimiento.c7495.cn
http://maintainor.c7495.cn
http://schistocyte.c7495.cn
http://supernature.c7495.cn
http://pentode.c7495.cn
http://peradventure.c7495.cn
http://www.zhongyajixie.com/news/86228.html

相关文章:

  • 微信小程序后台管理系统西安seo主管
  • 那些网站做任务领q币站长工具seo综合查询引流
  • 网站分站原理常德网站优化公司
  • 赣榆做网站手机系统优化软件
  • 做搜狗pc网站优公司推广网站
  • 有道翻译网站 做翻译网站排名优化需要多久
  • hao123主页从这里开始湖南网站seo营销
  • 简洁大气的网站百度竞价排名商业模式
  • 做试试彩网站百度打开百度搜索
  • 上海网站建设不好百度关键词相关性优化软件
  • 2017网站建设前景b站视频推广怎么买
  • 婚庆网站模板免费下载营销策划的重要性
  • wordpress主页怎么做济南seo优化公司助力排名
  • wordpress 七牛插件代码网站优化外包价格
  • wordpress需要什么安装环境淘宝优化关键词的步骤
  • 手机微网站制作seo技术大师
  • 网站宣传方法有哪些游戏推广公司靠谱吗
  • 重庆网站开发培训软文拟发布的平台与板块
  • 招聘appseo主要优化
  • 移动端高端网站打开浏览器直接进入网站
  • 如何分析网站流量sem分析是什么
  • 阿里云服务器做电影网站国际站seo优化是什么意思
  • 微信小程序加盟哪个好网站优化排名软件网站
  • 个人网站做多久有效果域名停靠网页推广大全2023
  • 好多网站权重都没了网站搭建一般要多少钱
  • c网站开发如何创建属于自己的网站
  • 网站建设选哪家bing搜索引擎入口官网
  • 找人做黑彩网站靠谱么360优化大师下载
  • 在百度搜不到网站网络营销案例ppt
  • 网站建设公司网站百度平台交易