Skip to main content

一个常用的工具代码包集合

Project description

kevin_toolbox

一个通用的工具代码包集合

环境要求

numpy>=1.19
pytorch>=1.2

安装方法:

pip install kevin-toolbox  --no-dependencies

项目地址 Repo

使用指南 User_Guide

免责声明 Disclaimer

版本更新记录

  • v 1.4.14 (2026-01-19)【bug fix】【new feature】【incompatible change】
    • env_info.variable_
      • 【new feature】add Vars_Parser,解释以ndl命名格式指定位置下的变量。
      • refactor Env_Vars_Parser with Vars_Parser,将 Env_Vars_Parser 改为依赖 Vars_Parser 实现的形式。
        • 出于兼容以往版本的考虑,我们在该版本中仍保留 Env_Vars_Parser,但我们强烈建议你改为使用 Vars_Parser 以获得更灵活高效的体验。
    • patches
      • for_matplotlib
        • common_charts
          • 【new feature】add plot_heatmap(), 绘制矩阵热力图(Heatmap)。
        • common_charts.utils
          • modify save_record() 修改以支持 label_formatter 参数为函数对象或"<eval>..."形式包裹的函数的情况。
      • for_optuna
        • 【new feature】add determine_whether_to_add_trial(),判断 hyper_paras 对应的 trial 是否应该添加到给定 study 中。
        • 【new feature】add enqueue_trials_without_duplicates(),将 hyper_paras_ls 对应的一系列 trials 添加到 study 中。
        • 添加了对应的测试用例。
      • for_test
        • modify check_consistency,新增参数 b_raise_error 用于控制检查到不一致时,是否引发报错。当设置为 False 时,将以 (<boolean>, <msg>) 的形式返回检查结果。
    • computer_science.algorithm
      • statistician
        • 【new feature】add Latest_Accumulator,用于保留最近一次add的值的累积器。
      • scheduler
        • 【bug fix】fix bug in Strategy_Manager
          • 将原来 line 218 中:先对 action_s 进行深拷贝再取出 p_value_func;改为先从 action_s 中取出 p_value_func 等待 p_value_func 进行可能的运算结束之后,再对 p_value_func 返回的结果深拷贝;前者在 p_value_func 为 callable 类实例且内部存在记忆变量时往往会因为对该实例本身进行深拷贝而产生意外结果,而后者对实例产生的结果再进行深拷贝就没有这个问题了。
          • 增加 b_deepcopy_p_value 参数用于控制是否对 p_value_func 产生的结果进行深拷贝。
      • cache_manager.cache
        • 【new feature】add Array_Cache,基于内存array的缓存结构。
          • 相较于基于dict的Memo_Cache,该类对于存储 Key 为非负整数(如索引 ID)的结构化数据更为友好。
      • redirector
        • 【new feature】add Passive_Redirectable_Sequence_Fetcher,辅助用户通过跳转来处理获取失败的情况。
          • 相较于 Redirectable_Sequence_Fetcher 主动去管理给定的 seq,并负责获取元素,判断获取是否成功,本类仅起到记忆和建议的功能,并不管理任何 seq,需要用户主动告知获取是否成功。这给与用户更大的灵活性。
        • refactor Redirectable_Sequence_Fetcher,改为依赖 Passive_Redirectable_Sequence_Fetcher 来实现功能。
      • sampler
        • 【new feature】add Moving_Reservoir_Sampler,滑动水库采样,对最近历史窗口内数据进行均匀采样。
        • 【incompatible change】modify Reservoir_Sampler,将原来 capacity 等参数更名为 target_nums 等。
        • 【new feature】add Vanilla_Sampler,一般的序列采样采样。

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kevin_toolbox_dev-1.4.14.tar.gz (233.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kevin_toolbox_dev-1.4.14-py3-none-any.whl (429.0 kB view details)

Uploaded Python 3

File details

Details for the file kevin_toolbox_dev-1.4.14.tar.gz.

File metadata

  • Download URL: kevin_toolbox_dev-1.4.14.tar.gz
  • Upload date:
  • Size: 233.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.7.11

File hashes

Hashes for kevin_toolbox_dev-1.4.14.tar.gz
Algorithm Hash digest
SHA256 4174510a0a6f3c60be14979a149fe27c67598159c22e64e8c1524691a2a0d2ec
MD5 f3143d0159626fe9a471b2fe58e7e3c4
BLAKE2b-256 04c63e9a93f9a55e0d91b2eefeddb729951ad1cd9f1506d7be6946eeef47bf17

See more details on using hashes here.

File details

Details for the file kevin_toolbox_dev-1.4.14-py3-none-any.whl.

File metadata

File hashes

Hashes for kevin_toolbox_dev-1.4.14-py3-none-any.whl
Algorithm Hash digest
SHA256 9c51186630d3d6f15174d86bbecdcedc4a2ca51fb2db0becea0fbd6505d134b9
MD5 c8738a8ac03ec0b3f76d890d098d0570
BLAKE2b-256 ee7c25b21c120c909bcc49f111483246f13e430e14fa3085b0d88a05edf423b1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page