Py之yacs:yacs的简介、安装、使用方法之详细攻略

yacs是一款轻量级的配置管理系统,专为科研实验设计,确保实验的可重复性。它使用YAML作为序列化格式,易于阅读且支持复杂的配置结构。本文详细介绍yacs的安装和基础使用方法,帮助你轻松上手。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Py之yacs:yacs的简介、安装、使用方法之详细攻略

 

 

目录

yacs的简介

yacs的安装

yacs的使用方法

1、基础用法


 

 

 

yacs的简介

       A simple experiment configuration system for research.
       yacs是作为一个轻量级库创建的,用于定义和管理系统配置,比如那些通常可以在为科学实验设计的软件中找到的配置。这些“配置”通常包括用于训练机器学习模型的超参数或可配置模型超参数(如卷积神经网络的深度)等概念。由于您正在进行科学研究,所以再现性是最重要的,因此您需要一种可靠的方法来序列化实验配置。YACS使用YAML作为一种简单的、人类可读的序列化格式。范例是:你的代码+实验E的yacs配置(+外部依赖+硬件+其他讨厌的术语…)=可重复的实验E。虽然你不能控制一切,但至少你可以控制你的代码和你的实验配置。yacs会帮你的。
       yacs是在py-fast -rcnn和Detectron中使用的实验配置系统中发展起来的。

 

 

yacs的安装

pip install yacs

 

yacs的使用方法

1、基础用法

# my_project/config.py
from yacs.config import CfgNode as CN


_C = CN()

_C.SYSTEM = CN()
# Number of GPUS to use in the experiment
_C.SYSTEM.NUM_GPUS = 8
# Number of workers for doing things
_C.SYSTEM.NUM_WORKERS = 4

_C.TRAIN = CN()
# A very important hyperparameter
_C.TRAIN.HYPERPARAMETER_1 = 0.1
# The all important scales for the stuff
_C.TRAIN.SCALES = (2, 4, 8, 16)


def get_cfg_defaults():
  """Get a yacs CfgNode object with default values for my_project."""
  # Return a clone so that the defaults will not be altered
  # This is for the "local variable" use pattern
  return _C.clone()

# Alternatively, provide a way to import the defaults as
# a global singleton:
# cfg = _C  # users can `from config import cfg`

 

 

 

 

YACS 是一个强大的 PHP 脚本,可以让你维护一个动态的 Web 服务器。特性:- Runs on your own server, or on a shared web site- Post articles with web forms, by e-mail, or remotely (w:bloggar)- Embed images and photos in articles --automatic resize- Each section can be a weblog, a discussion board, a book of cooking recipes,etc, or even a plain list of articles- Overlay interface for PHP developers, to add extra functionality to articles,such as polls or cooking recipes- Display the content tree in Freemind- Comments, with quoting- Archives per week and per month- The home page is updated automatically on article publishing- Categories, sub-categories, etc. --Build your own Yahoo! or DMOZ...- Real-time meetings with community members- Private discussions and messages- Search on any word --text of articles is fully indexed- Multiple authors --actually, a community of contributors- Articles are visible only on publication after review by editors- Articles and sections can have dead-line to limit visibility over time- A straightforward control panel, and a set of configuration panels- File upload to articles , sections or categories- Attach links to articles, sections or categories- A comprehensive set of UBB-like codes are available to beautify your posts- Integrated support of TinyMCE and of FCKEditor- Fully customizable skins- Easy integration of Google Maps- Add a comprehensive web interface to existing collections of files- Support audio-on demand and video-on demand- Automatic web slideshow for shared photos- RSS syndication- Easy installation- XML-RPC interface (implementing the Blogger API and metaWeblog API) 标签:YACS
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

一个处女座的程序猿

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值