06 2024 档案
摘要:Transformers 源码解析(一百二十八) .\models\xlm_roberta_xl\__init__.py # 引入类型检查模块 from typing import TYPE_CHECKING # 引入自定义的异常和模块懒加载工具函数 from ...utils import Opt
阅读全文
摘要:Transformers 源码解析(一百二十) .\models\vit_msn\__init__.py # 导入所需模块和函数 from typing import TYPE_CHECKING # 从当前项目的utils模块中导入异常类和LazyModule类,还有is_torch_availab
阅读全文
摘要:Transformers 源码解析(一百) .\models\seamless_m4t\convert_fairseq2_to_hf.py # 指定 Python 文件的编码格式为 UTF-8 # 版权声明,声明代码版权归 The HuggingFace Inc. 团队所有,保留所有权利 # # 根
阅读全文
摘要:Transformers 源码解析(一) .\activations.py # 导入必要的库 import math from collections import OrderedDict # 导入 PyTorch 相关模块 import torch from packaging import ve
阅读全文
摘要:Transformers 源码解析(五十一) .\models\funnel\modeling_tf_funnel.py # coding=utf-8 # Copyright 2020-present Google Brain and Carnegie Mellon University Autho
阅读全文
摘要:Transformers 源码解析(五十五) .\models\gptsan_japanese\tokenization_gptsan_japanese.py # 指定文件编码为 UTF-8 # 版权声明,版权归 HuggingFace Inc. 团队所有 # # 根据 Apache 许可证 2.0
阅读全文
摘要:Transformers 源码解析(五十四) .\models\gpt2\tokenization_gpt2.py # 设置脚本的编码格式为UTF-8 # 引入必要的模块和函数 import json # 导入用于 JSON 操作的模块 import os # 导入用于操作系统功能的模块 from
阅读全文
摘要:Transformers 源码解析(五十三) .\models\glpn\convert_glpn_to_pytorch.py # 导入必要的模块和库 import argparse # 导入命令行参数解析模块 from collections import OrderedDict # 导入有序字典
阅读全文
摘要:Transformers 源码解析(五十七) .\models\groupvit\modeling_tf_groupvit.py # coding=utf-8 # Copyright 2022 NVIDIA and The HuggingFace Team. All rights reserved.
阅读全文
摘要:Transformers 源码解析(五十六) .\models\gpt_neox\tokenization_gpt_neox_fast.py # 设置脚本文件的编码格式为UTF-8 # 版权声明,指出此代码的版权归EleutherAI和The HuggingFace Inc.团队所有 # # 根据A
阅读全文
摘要:Transformers 源码解析(五十九) .\models\idefics\perceiver.py def __init__( self, config: IdeficsConfig, embed_dim: int, depth: int, n_heads: int, head_dim: in
阅读全文
摘要:Transformers 源码解析(五十二) .\models\gemma\convert_gemma_weights_to_hf.py # 版权声明和信息 # Copyright 2024 The HuggingFace Inc. team. All rights reserved. # # Li
阅读全文
摘要:Transformers 源码解析(五十八) .\models\hubert\modeling_tf_hubert.py # 设置编码为 UTF-8 # 版权声明,指明版权归 Fairseq 作者和 HuggingFace Inc. 团队所有 # # 根据 Apache License, Versi
阅读全文
摘要:Transformers 源码解析(五十) .\models\fnet\tokenization_fnet.py # coding=utf-8 # 上面的行声明了文件编码格式为 UTF-8,确保可以正确处理中文和其他特殊字符 # Copyright 2021 Google Research, Goo
阅读全文
摘要:Transformers 源码解析(五) .\generation\stopping_criteria.py # 导入时间模块,用于处理时间相关功能 import time # 导入警告模块,用于发出警告信息 import warnings # 导入抽象基类模块,用于定义抽象类 from abc i
阅读全文
摘要:Transformers 源码解析(四十一) .\models\distilbert\tokenization_distilbert.py # coding=utf-8 # Copyright 2018 The HuggingFace Inc. team. # # Licensed under th
阅读全文
摘要:Transformers 源码解析(四十五) .\models\encodec\feature_extraction_encodec.py # 指定代码文件的编码格式为UTF-8 # 版权声明,声明此代码版权归HuggingFace Inc.团队所有,保留所有权利 # 根据Apache Licens
阅读全文
摘要:Transformers 源码解析(四十四) .\models\electra\modeling_flax_electra.py # 引入必要的库和模块 from typing import Callable, Optional, Tuple # 导入类型提示相关的模块 import flax #
阅读全文
摘要:Transformers 源码解析(四十三) .\models\efficientformer\image_processing_efficientformer.py # 导入所需模块和类,包括类型提示和必要的功能函数 from typing import Dict, List, Optional,
阅读全文
摘要:Transformers 源码解析(四十七) .\models\esm\openfold_utils\chunk_utils.py # 导入日志和数学库 import logging import math # 导入偏函数模块 from functools import partial # 导入类型
阅读全文
摘要:Transformers 源码解析(四十六) .\models\ernie_m\tokenization_ernie_m.py # coding=utf-8 # 上面的注释声明了文件的编码格式为 UTF-8,并非代码实际操作,仅为信息说明 # 版权声明,指出该文件的版权归属于 Xuan Ouyang
阅读全文
摘要:Transformers 源码解析(四十九) .\models\flaubert\__init__.py # 导入必要的模块和函数 from typing import TYPE_CHECKING # 引入自定义的异常类和模块加载函数 from ...utils import OptionalDep
阅读全文
摘要:Transformers 源码解析(四十二) .\models\dpr\tokenization_dpr.py # coding=utf-8 # Copyright 2018 The HuggingFace Inc. team, The Hugging Face Team. # # Licensed
阅读全文
摘要:Transformers 源码解析(四十八) .\models\falcon\__init__.py # 设置编码格式为 UTF-8 # 版权声明,标明 Falcon 作者和 HuggingFace Inc. 团队的版权 # 根据 Apache License, Version 2.0 许可证,使用
阅读全文
摘要:Transformers 源码解析(四十) .\models\dinat\__init__.py # 版权声明和许可证声明,指明版权所有者及许可协议 # Copyright 2022 The HuggingFace Team. All rights reserved. # # Licensed un
阅读全文
摘要:Transformers 源码解析(四) .\deepspeed.py # 引入警告模块,用于向用户显示有关未来变更或不推荐使用的信息 import warnings # 发出警告,提示用户 transformers.deepspeed 模块已被弃用,并且将在未来的版本中移除 warnings.wa
阅读全文
摘要:Transformers 源码解析(十一) .\models\audio_spectrogram_transformer\feature_extraction_audio_spectrogram_transformer.py """ Feature extractor class for Audio
阅读全文
摘要:Transformers 源码解析(十五) .\models\bert\modeling_flax_bert.py # 导入所需的模块和类 from typing import Callable, Optional, Tuple # 导入类型注解相关的类和方法 import flax # 导入 Fl
阅读全文
摘要:Transformers 源码解析(十四) .\models\bartpho\__init__.py # 版权声明和许可信息,声明版权归 HuggingFace 团队所有,授权遵循 Apache License 2.0 # # 导入必要的类型检查模块 from typing import TYPE_
阅读全文
摘要:Transformers 源码解析(十三) .\models\bart\modeling_flax_bart.py # coding=utf-8 # Copyright 2021 The Fairseq Authors and The Google Flax Team Authors And The
阅读全文
摘要:Transformers 源码解析(十七) .\models\bigbird_pegasus\__init__.py # 版权声明及许可信息 # # 版权所有 2021 年 HuggingFace 团队。保留所有权利。 # # 根据 Apache 许可证 2.0 版本("许可证")许可; # 除非符
阅读全文
摘要:Transformers 源码解析(十六) .\models\bert\__init__.py # 从 typing 模块导入 TYPE_CHECKING 类型检查工具 from typing import TYPE_CHECKING # 从 ...utils 中导入必要的模块和异常类 from .
阅读全文
摘要:Transformers 源码解析(十九) .\models\blenderbot\modeling_tf_blenderbot.py # coding=utf-8 # 版权所有 2021 年 Facebook, Inc 和 HuggingFace Inc. 团队。保留所有权利。 # # 根据 Ap
阅读全文
摘要:Transformers 源码解析(十二) .\models\auto\__init__.py # 引入类型检查标记,用于条件检查时的类型提示 from typing import TYPE_CHECKING # 从 utils 模块中导入所需内容 from ...utils import ( Op
阅读全文
摘要:Transformers 源码解析(十八) .\models\big_bird\__init__.py # 导入必要的类型检查模块 from typing import TYPE_CHECKING # 导入相关的依赖项和模块 from ...utils import ( OptionalDepend
阅读全文
摘要:Transformers 源码解析(十) .\models\albert\tokenization_albert_fast.py # coding=utf-8 # Copyright 2018 Google AI, Google Brain and the HuggingFace Inc. team
阅读全文
摘要:Transformers 源码解析(三十一) .\models\ctrl\__init__.py # 版权声明和许可信息 # # 根据 Apache 许可证 2.0 版本授权,除非符合许可证的规定,否则不得使用此文件。 # 您可以在以下链接获取许可证的副本: # # http://www.apach
阅读全文
摘要:Transformers 源码解析(三十五) .\models\deformable_detr\__init__.py # 版权声明和许可证信息,指明该代码的版权归属和许可证条款 # Copyright 2022 The HuggingFace Team. All rights reserved.
阅读全文
摘要:Transformers 源码解析(三十四) .\models\deberta_v2\tokenization_deberta_v2.py # coding=utf-8 # Copyright 2020 Microsoft and the HuggingFace Inc. team. # # Lic
阅读全文
摘要:Transformers 源码解析(三十三) .\models\deberta\modeling_tf_deberta.py # 定义 TFDebertaContextPooler 类,用于处理 DeBERTa 模型的上下文池化操作 class TFDebertaContextPooler(kera
阅读全文
摘要:Transformers 源码解析(三十七) .\models\deprecated\transfo_xl\convert_transfo_xl_original_tf_checkpoint_to_pytorch.py # 设置文件编码为 UTF-8 # 版权声明,使用 Apache 许可证 2.0
阅读全文
摘要:Transformers 源码解析(三十六) .\models\deprecated\mmbt\__init__.py # 版权声明和许可证信息,声明版权归 HuggingFace Team 所有,遵循 Apache License, Version 2.0。 # 可以在符合许可证的前提下使用此文件
阅读全文
摘要:Transformers 源码解析(三十九) .\models\detr\convert_detr_original_pytorch_checkpoint_to_pytorch.py # coding=utf-8 # Copyright 2020 The HuggingFace Inc. team.
阅读全文
摘要:Transformers 源码解析(三十二) .\models\data2vec\modeling_data2vec_text.py # 设置文件编码为UTF-8,确保支持中文等多种字符集 # 版权声明,告知代码的版权归属于The HuggingFace Inc.团队 # # 根据Apache许可证
阅读全文
摘要:Transformers 源码解析(三十八) .\models\depth_anything\convert_depth_anything_to_hf.py # coding=utf-8 # 版权 2024 年 HuggingFace Inc. 团队所有。 # # 根据 Apache 许可证 2.0
阅读全文
摘要:Transformers 源码解析(三十) .\models\convnextv2\modeling_convnextv2.py # coding=utf-8 # Copyright 2023 Meta Platforms, Inc. and The HuggingFace Inc. team. A
阅读全文
摘要:Transformers 源码解析(三) .\convert_slow_tokenizers_checkpoints_to_fast.py # 设置脚本的编码格式为 UTF-8 # 版权声明,此代码归 HuggingFace Inc. 团队所有,使用 Apache 许可证 2.0 版本 # # 根据
阅读全文
摘要:Transformers 源码解析(七十一) .\models\mask2former\modeling_mask2former.py # 设置文件编码为 UTF-8 # 版权声明,指出 Meta Platforms, Inc. 和 The HuggingFace Inc. 团队的版权信息 # 版权
阅读全文
摘要:Transformers 源码解析(七十五) .\models\mistral\modeling_mistral.py # 设置文件编码为UTF-8 # 版权声明和许可信息,基于Mistral AI和HuggingFace Inc.团队的代码 # 本代码基于EleutherAI的GPT-NeoX库和
阅读全文
摘要:Transformers 源码解析(七十四) .\models\mega\__init__.py # Copyright 2023 The HuggingFace Team. All rights reserved. # 版权声明及许可信息,指明该代码的版权归属及使用许可 # # Licensed
阅读全文
摘要:Transformers 源码解析(七十三) .\models\mbart\modeling_tf_mbart.py # 设置文件编码为UTF-8 # 版权声明,声明此代码的版权归The Fairseq Authors和The HuggingFace Inc.团队所有 # 根据Apache许可证2.
阅读全文
摘要:Transformers 源码解析(七十七) .\models\mobilenet_v2\modeling_mobilenet_v2.py # coding=utf-8 # Copyright 2022 Apple Inc. and The HuggingFace Inc. team. All ri
阅读全文
摘要:Transformers 源码解析(七十六) .\models\mobilebert\modeling_tf_mobilebert.py # coding=utf-8 # Copyright 2018 The Google AI Language Team Authors and The Huggi
阅读全文
摘要:Transformers 源码解析(七十九) .\models\mpnet\tokenization_mpnet_fast.py # coding=utf-8 # 文件编码声明,指定文件采用UTF-8编码格式 # Copyright 2018 The HuggingFace Inc. team, M
阅读全文
摘要:Transformers 源码解析(七十二) .\models\maskformer\modeling_maskformer.py # coding=utf-8 # Copyright 2022 Meta Platforms, Inc. and The HuggingFace Inc. team.
阅读全文
摘要:Transformers 源码解析(七十八) .\models\mobilevit\__init__.py # 引入类型检查工具,用于类型检查 from typing import TYPE_CHECKING # 从当前包中的工具模块导入相关依赖 from ...utils import ( Opt
阅读全文
摘要:Transformers 源码解析(七十) .\models\marian\tokenization_marian.py # 导入所需的模块和库 import json # 导入处理 JSON 数据的模块 import os # 导入操作系统功能的模块 import re # 导入正则表达式模块 i
阅读全文
摘要:Transformers 源码解析(七) .\kernels\deformable_detr\cpu\ms_deform_attn_cpu.cpp /*! ************************************************************************
阅读全文
摘要:Transformers 源码解析(六十一) .\models\kosmos2\processing_kosmos2.py # coding=utf-8 # 上面是指定文件编码为 UTF-8 # 版权声明,版权归 Microsoft Research 和 HuggingFace Inc. 团队所有
阅读全文
摘要:Transformers 源码解析(六十五) .\models\llama\tokenization_llama.py # coding=utf-8 # Copyright 2022 EleutherAI and the HuggingFace Inc. team. All rights reser
阅读全文
摘要:Transformers 源码解析(六十四) .\models\led\tokenization_led.py # coding=utf-8 # 版权所有 2021 Iz Beltagy,Matthew E. Peters,Arman Cohan 和 HuggingFace Inc. 团队。保留所有
阅读全文
摘要:Transformers 源码解析(六十三) .\models\layoutlmv3\processing_layoutlmv3.py """ Processor class for LayoutLMv3. """ # 导入警告模块 import warnings # 引入类型提示模块中的相关类型
阅读全文
摘要:Transformers 源码解析(六十七) .\models\longt5\modeling_longt5.py # coding=utf-8 # Copyright 2022 Google LLC., LongT5 Authors and HuggingFace Inc. team. # # L
阅读全文
摘要:Transformers 源码解析(六十六) .\models\longformer\modeling_tf_longformer.py # 导入警告模块,用于处理警告信息 import warnings # 导入数据类装饰器,用于定义数据类 from dataclasses import data
阅读全文
摘要:Transformers 源码解析(六十九) .\models\mamba\__init__.py # 版权声明和许可证信息 # 版权 2024 年 HuggingFace 团队保留所有权利。 # # 根据 Apache 许可证 2.0 版本(“许可证”)授权; # 除非符合许可证的规定,否则不得使
阅读全文
摘要:Transformers 源码解析(六十二) .\models\layoutlmv2\processing_layoutlmv2.py # coding=utf-8 # Copyright 2021 The HuggingFace Inc. team. # # Licensed under the
阅读全文
摘要:Transformers 源码解析(六十八) .\models\lxmert\modeling_tf_lxmert.py # coding=utf-8 # 定义文件编码为 UTF-8 # 版权声明:以下代码由 Google AI Language Team Authors、HuggingFace I
阅读全文
摘要:Transformers 源码解析(六十) .\models\instructblip\processing_instructblip.py # coding=utf-8 # Copyright 2023 The HuggingFace Inc. team. # # Licensed under t
阅读全文
摘要:Transformers 源码解析(六) .\image_utils.py # 导入必要的库和模块 import base64 # 用于 base64 编解码 import os # 系统操作相关功能 from io import BytesIO # 提供字节流操作 from typing impo
阅读全文
摘要:Transformers 源码解析(九十一) .\models\pvt_v2\__init__.py # coding=utf-8 # 版权所有 2023 作者:Wenhai Wang, Enze Xie, Xiang Li, Deng-Ping Fan, # Kaitao Song, Ding L
阅读全文
摘要:Transformers 源码解析(九十五) .\models\roberta\convert_roberta_original_pytorch_checkpoint_to_pytorch.py # 设置 Python 文件编码格式为 UTF-8 # 版权声明和许可协议,这里是 Apache Lic
阅读全文
摘要:Transformers 源码解析(九十四) .\models\rembert\modeling_tf_rembert.py # 设置编码格式为 UTF-8 # 版权声明及许可信息 # # 根据 Apache 许可证 2.0 版本使用此文件 # 除非符合许可证的条款,否则不得使用此文件 # 您可以在
阅读全文
摘要:Transformers 源码解析(九十三) .\models\reformer\tokenization_reformer_fast.py # 设置文件编码为 UTF-8 # 版权声明及许可协议信息 # 引入操作系统模块和复制文件函数 # 引入类型提示模块中的 Optional 和 Tuple 类
阅读全文
摘要:Transformers 源码解析(九十七) .\models\roberta_prelayernorm\__init__.py # 引入类型检查依赖,用于在类型检查环境下做条件导入 from typing import TYPE_CHECKING # 从工具模块中导入相关工具和异常 from ..
阅读全文
摘要:Transformers 源码解析(九十六) .\models\roberta\tokenization_roberta_fast.py # coding=utf-8 # Copyright 2018 The Open AI Team Authors and The HuggingFace Inc.
阅读全文
摘要:Transformers 源码解析(九十九) .\models\sam\image_processing_sam.py # 指定编码格式为 UTF-8 # 版权声明和许可信息 # 根据 Apache 许可证 2.0 版本,除非符合许可证规定,否则不得使用此文件 # 获取许可证的详细信息,请访问指定的
阅读全文
摘要:Transformers 源码解析(九十二) .\models\rag\tokenization_rag.py # coding=utf-8 # 声明文件编码格式为 UTF-8 # 版权声明和许可证信息 # 导入必要的模块和类 import os import warnings from typin
阅读全文
摘要:Transformers 源码解析(九十八) .\models\roformer\modeling_tf_roformer.py # 导入所需模块和库 import math from typing import Dict, Optional, Tuple, Union import numpy a
阅读全文
摘要:Transformers 源码解析(九十) .\models\pop2piano\tokenization_pop2piano.py # coding=utf-8 # Copyright 2023 The Pop2Piano Authors and The HuggingFace Inc. team
阅读全文
摘要:Transformers 源码解析(九) .\models\albert\configuration_albert.py # 引入 OrderedDict 用于有序字典,Mapping 用于类型提示 from collections import OrderedDict from typing im
阅读全文
摘要:Transformers 源码解析(二十一) .\models\blip\modeling_tf_blip_text.py # 导入所需的库和模块 from __future__ import annotations import math # 导入数学库,用于数学运算 from typing im
阅读全文
摘要:Transformers 源码解析(二十五) .\models\clap\processing_clap.py """ Audio/Text processor class for CLAP """ from ...processing_utils import ProcessorMixin # 导
阅读全文
摘要:Transformers 源码解析(二十四) .\models\canine\tokenization_canine.py # coding=utf-8 # Copyright Google AI and The HuggingFace Inc. team. All rights reserved.
阅读全文
摘要:Transformers 源码解析(二十三) .\models\bros\processing_bros.py # 设置编码格式为 UTF-8,确保支持中文等多种字符 # 版权声明,指明此代码版权归 HuggingFace Inc. 团队所有,遵循 Apache License 2.0 # 详细许可
阅读全文
摘要:Transformers 源码解析(二十七) .\models\clvp\number_normalizer.py # coding=utf-8 # Copyright 2023 The HuggingFace Inc. team. # # Licensed under the Apache Lic
阅读全文
摘要:Transformers 源码解析(二十六) .\models\clip\processing_clip.py # coding=utf-8 # 版权所有 2021 年 HuggingFace Inc. 团队 # # 根据 Apache 许可证 2.0 版本进行许可;除非符合许可证,否则不得使用此文
阅读全文
摘要:Transformers 源码解析(二十九) .\models\convbert\modeling_tf_convbert.py # coding=utf-8 # Copyright 2021 The HuggingFace Inc. team. All rights reserved. # # L
阅读全文
摘要:Transformers 源码解析(二十二) .\models\bloom\modeling_flax_bloom.py # 导入所需的模块和库 import math from functools import partial from typing import Optional, Tuple
阅读全文
摘要:Transformers 源码解析(二十八) .\models\conditional_detr\feature_extraction_conditional_detr.py # 设置编码格式为 UTF-8 # 版权声明和许可条款,指明此代码的版权归 HuggingFace Inc. 团队所有,遵循
阅读全文
摘要:Transformers 源码解析(二十) .\models\blenderbot_small\tokenization_blenderbot_small.py # coding=utf-8 # 版权 2021 年 Facebook Inc. 和 HuggingFace Inc. 团队保留所有权利。
阅读全文
摘要:Transformers 源码解析(二) .\commands\convert.py # 导入必要的模块和类 from argparse import ArgumentParser, Namespace # 导入参数解析相关模块 from ..utils import logging # 导入日志工
阅读全文
摘要:Transformers 源码解析(八十一) .\models\mvp\tokenization_mvp.py # coding=utf-8 # Copyright 2022 The Facebook AI Research Team Authors and The HuggingFace Inc.
阅读全文
摘要:Transformers 源码解析(八十五) .\models\owlv2\image_processing_owlv2.py # coding=utf-8 # Copyright 2023 The HuggingFace Inc. team. All rights reserved. # # Li
阅读全文
摘要:Transformers 源码解析(八十四) .\models\openai\modeling_tf_openai.py # 定义 TFAttention 类,继承自 keras.layers.Layer,用于实现注意力机制 class TFAttention(keras.layers.Layer)
阅读全文
摘要:Transformers 源码解析(八十三) .\models\oneformer\image_processing_oneformer.py # coding=utf-8 # Copyright 2022 SHI Labs and The HuggingFace Inc. team. All ri
阅读全文
摘要:Transformers 源码解析(八十七) .\models\pegasus\modeling_pegasus.py # 设置文件编码格式为 UTF-8 # 版权声明,指出版权归 Google 和 HuggingFace Inc. 团队所有 # # 根据 Apache 许可证 2.0 版本,除非符
阅读全文
摘要:Transformers 源码解析(八十六) .\models\owlvit\processing_owlvit.py # coding=utf-8 # Copyright 2022 The HuggingFace Inc. team. # # Licensed under the Apache L
阅读全文
摘要:Transformers 源码解析(八十九) .\models\pix2struct\processing_pix2struct.py # coding=utf-8 # Copyright 2023 The HuggingFace Inc. team. # # Licensed under the
阅读全文
摘要:Transformers 源码解析(八十二) .\models\nllb_moe\modeling_nllb_moe.py # 定义一个函数,根据输入的 `input_ids` 张量,将其中的 token 向右移动一位 def shift_tokens_right(input_ids: torch.
阅读全文
摘要:Transformers 源码解析(八十八) .\models\perceiver\tokenization_perceiver.py # coding=utf-8 # 版权 2021 年 HuggingFace Inc. 团队。 # # 根据 Apache 许可证版本 2.0 授权。 # 除非符合
阅读全文
摘要:Transformers 源码解析(八十) .\models\mt5\modeling_tf_mt5.py # 设置文件编码为UTF-8 # 版权声明,指出代码的版权归属 # 版权使用协议,告知可在Apache License Version 2.0下使用 # 获取Apache License Ve
阅读全文
摘要:Transformers 源码解析(八) .\modeling_tf_outputs.py # 导入警告模块,用于处理警告信息 import warnings # 导入数据类装饰器,用于定义数据类 from dataclasses import dataclass # 导入类型提示,用于类型注解 f
阅读全文
摘要:Lucidrains 系列项目源码解析(一) .\lucidrains\Adan-pytorch\adan_pytorch\adan.py import math import torch from torch.optim import Optimizer # 定义一个函数,用于检查变量是否存在 d
阅读全文
摘要:Lucidrains 系列项目源码解析(五十一) .\lucidrains\x-transformers\x_transformers\xval.py """ 定义了一个基于离散标记的常规变换器,但对于数字是连续的 更好地泛化了算术 https://arxiv.org/abs/2310.02989
阅读全文
摘要:Lucidrains 系列项目源码解析(五十) .\lucidrains\x-clip\setup.py # 导入设置和查找包的函数 from setuptools import setup, find_packages # 设置包的信息 setup( # 包的名称 name = 'x-clip',
阅读全文
摘要:Lucidrains 系列项目源码解析(五) .\lucidrains\byol-pytorch\byol_pytorch\trainer.py # 导入必要的库 from pathlib import Path import torch import torch.distributed as di
阅读全文
摘要:Lucidrains 系列项目源码解析(四十一) .\lucidrains\soundstorm-pytorch\soundstorm_pytorch\trainer.py # 导入必要的模块 from pathlib import Path import re from shutil import
阅读全文
摘要:Lucidrains 系列项目源码解析(四十五) .\lucidrains\triton-transformer\triton_transformer\cross_entropy.py # 导入 torch 库 import torch # 导入 torch 中的函数库 import torch.n
阅读全文
摘要:Lucidrains 系列项目源码解析(四十四) .\lucidrains\toolformer-pytorch\toolformer_pytorch\tools.py # 导入所需的库 import os # 尝试导入所需的库,如果导入失败则输出错误信息并退出程序 try: # 从dotenv库中
阅读全文
摘要:Lucidrains 系列项目源码解析(四十三) .\lucidrains\tf-bind-transformer\scripts\fetch_factor_fastas.py # 导入所需的库 import requests from pathlib import Path import clic
阅读全文
摘要:Lucidrains 系列项目源码解析(四十七) .\lucidrains\vit-pytorch\setup.py # 导入设置和查找包的函数 from setuptools import setup, find_packages # 设置包的元数据 setup( # 包的名称 name = 'v
阅读全文
摘要:Lucidrains 系列项目源码解析(四十六) .\lucidrains\vector-quantize-pytorch\vector_quantize_pytorch\residual_vq.py # 导入必要的库 import random from math import ceil from
阅读全文
摘要:Lucidrains 系列项目源码解析(四十九) .\lucidrains\vit-pytorch\vit_pytorch\vit_3d.py import torch # 导入 PyTorch 库 from torch import nn # 从 PyTorch 库中导入 nn 模块 from e
阅读全文
摘要:Lucidrains 系列项目源码解析(四十二) .\lucidrains\st-moe-pytorch\st_moe_pytorch\__init__.py # 从 st_moe_pytorch.st_moe_pytorch 模块中导入 MoE 和 SparseMoEBlock 类 from st
阅读全文
摘要:Lucidrains 系列项目源码解析(四十八) .\lucidrains\vit-pytorch\vit_pytorch\mobile_vit.py import torch import torch.nn as nn from einops import rearrange from einop
阅读全文
摘要:Lucidrains 系列项目源码解析(四十) Data source The enwik8 data was downloaded from the Hutter prize page: http://prize.hutter1.net/ .\lucidrains\sinkhorn-transfo
阅读全文
摘要:Lucidrains 系列项目源码解析(四) .\lucidrains\big-sleep\big_sleep\cli.py # 导入 fire 模块,用于命令行接口 import fire # 导入 random 模块并重命名为 rnd import random as rnd # 从 big_s
阅读全文
摘要:Lucidrains 系列项目源码解析(十一) .\lucidrains\denoising-diffusion-pytorch\denoising_diffusion_pytorch\attend.py # 导入必要的模块和类 from functools import wraps from pa
阅读全文
摘要:Lucidrains 系列项目源码解析(十四) Electra - Pytorch A simple working wrapper for fast pretraining of language models as detailed in this paper. It speeds up tra
阅读全文
摘要:Lucidrains 系列项目源码解析(十三) .\lucidrains\diffusion-policy\setup.py # 导入设置工具和查找包的函数 from setuptools import setup, find_packages # 设置包的元数据 setup( name = 'di
阅读全文
摘要:Lucidrains 系列项目源码解析(十七) Flexible Diffusion Modeling of Long Videos - Pytorch (wip) Implementation of the video diffusion model and training scheme pre
阅读全文
摘要:Lucidrains 系列项目源码解析(十六) .\lucidrains\feedback-transformer-pytorch\setup.py # 导入设置和查找包的函数 from setuptools import setup, find_packages # 设置包的元数据 setup(
阅读全文
摘要:Lucidrains 系列项目源码解析(十九) .\lucidrains\gigagan-pytorch\gigagan_pytorch\version.py # 定义变量 __version__,赋值为字符串 '0.2.20' __version__ = '0.2.20' .\lucidrains
阅读全文
摘要:Lucidrains 系列项目源码解析(十二) .\lucidrains\denoising-diffusion-pytorch\denoising_diffusion_pytorch\karras_unet.py """ the magnitude-preserving unet proposed
阅读全文
摘要:Lucidrains 系列项目源码解析(十八) .\lucidrains\geometric-vector-perceptron\examples\data_utils.py # 作者:Eric Alcaide # 导入必要的库 import os import sys # 科学计算库 import
阅读全文
摘要:Lucidrains 系列项目源码解析(十) .\lucidrains\DALLE2-pytorch\setup.py # 导入所需的模块和函数 from setuptools import setup, find_packages # 执行版本文件中的代码,将版本信息导入当前环境 exec(ope
阅读全文
摘要:Lucidrains 系列项目源码解析(三十一) .\lucidrains\PaLM-pytorch\palm_pytorch\triton\layernorm.py # 从 Phil Tillet 的 Triton 的 layernorm 教程中获取的代码 # Triton - https://t
阅读全文
摘要:Lucidrains 系列项目源码解析(三十四) .\lucidrains\pixel-level-contrastive-learning\pixel_level_contrastive_learning\__init__.py # 从 pixel_level_contrastive_learni
阅读全文
摘要:Lucidrains 系列项目源码解析(三十五) .\lucidrains\q-transformer\q_transformer\q_robotic_transformer.py # 从 random 模块导入 random 函数 from random import random # 从 fun
阅读全文
摘要:Lucidrains 系列项目源码解析(三十三) .\lucidrains\perfusion-pytorch\perfusion_pytorch\save_load.py # 导入所需的模块 from pathlib import Path import torch from torch impo
阅读全文
摘要:Lucidrains 系列项目源码解析(三十七) .\lucidrains\RETRO-pytorch\retro_pytorch\training.py import numpy as np from functools import partial import json from pathli
阅读全文
摘要:Lucidrains 系列项目源码解析(三十六) Data source The enwik8 data was downloaded from the Hutter prize page: http://prize.hutter1.net/ Reformer with Deepspeed for
阅读全文
摘要:Lucidrains 系列项目源码解析(三十九) .\lucidrains\se3-transformer-pytorch\se3_transformer_pytorch\spherical_harmonics.py # 从 math 模块中导入 pi 和 sqrt 函数 # 从 functools
阅读全文
摘要:Lucidrains 系列项目源码解析(三十二) Parti - Pytorch Implementation of Parti, Google's pure attention-based text-to-image neural network, in Pytorch. Project Page
阅读全文
摘要:Lucidrains 系列项目源码解析(三十八) .\lucidrains\routing-transformer\routing_transformer\routing_transformer.py # 导入 torch 库 import torch # 导入 torch 中的神经网络模块 imp
阅读全文
摘要:Lucidrains 系列项目源码解析(三十) .\lucidrains\nuwa-pytorch\nuwa_pytorch\optimizer.py # 导入 torch 库 import torch # 从 torch.optim 中导入 AdamW 和 Adam 优化器 # 分离可进行权重衰减
阅读全文
摘要:Lucidrains 系列项目源码解析(三) .\lucidrains\audiolm-pytorch\audiolm_pytorch\data.py # 导入必要的模块 from pathlib import Path from functools import partial, wraps #
阅读全文
摘要:Lucidrains 系列项目源码解析(七) .\lucidrains\compressive-transformer-pytorch\setup.py # 导入设置和查找包的函数 from setuptools import setup, find_packages # 设置包的元数据 setup
阅读全文
摘要:Lucidrains 系列项目源码解析(六) .\lucidrains\CoCa-pytorch\coca_pytorch\__init__.py # 从 coca_pytorch 模块中导入 CoCa 类 from coca_pytorch.coca_pytorch import CoCa CoC
阅读全文
摘要:Lucidrains 系列项目源码解析(九) Dataloaders In order to make loading data simple and efficient, we include some general dataloaders that can be used to train p
阅读全文
摘要:Lucidrains 系列项目源码解析(二十一) .\lucidrains\imagen-pytorch\setup.py # 导入设置工具和查找包工具 from setuptools import setup, find_packages # 执行版本文件中的代码,将版本信息导入当前环境 exec
阅读全文
摘要:Lucidrains 系列项目源码解析(二十五) .\lucidrains\med-seg-diff-pytorch\setup.py # 导入设置工具和查找包工具 from setuptools import setup, find_packages # 设置包的信息 setup( # 包名 na
阅读全文
摘要:Lucidrains 系列项目源码解析(二十四) .\lucidrains\magvit2-pytorch\magvit2_pytorch\optimizer.py # 从 torch.optim 模块中导入 AdamW 和 Adam 优化器 from torch.optim import Adam
阅读全文
摘要:Lucidrains 系列项目源码解析(二十三) .\lucidrains\lion-pytorch\setup.py # 导入设置和查找包的函数 from setuptools import setup, find_packages # 设置包的元数据 setup( name = 'lion-py
阅读全文
摘要:Lucidrains 系列项目源码解析(二十七) .\lucidrains\metaformer-gpt\setup.py # 导入设置工具和查找包的函数 from setuptools import setup, find_packages # 设置包的信息 setup( # 包的名称 name
阅读全文
摘要:Lucidrains 系列项目源码解析(二十六) .\lucidrains\memory-efficient-attention-pytorch\memory_efficient_attention_pytorch\memory_efficient_cosine_sim_attention.py i
阅读全文
摘要:Lucidrains 系列项目源码解析(二十九) .\lucidrains\naturalspeech2-pytorch\naturalspeech2_pytorch\attend.py # 导入必要的库 from collections import namedtuple from functoo
阅读全文
摘要:Lucidrains 系列项目源码解析(二十二) .\lucidrains\lightweight-gan\lightweight_gan\diff_augment.py # 导入random模块 import random # 导入torch模块及其子模块 import torch import
阅读全文
摘要:Lucidrains 系列项目源码解析(二十八) .\lucidrains\multistream-transformers\multistream_transformers\__init__.py # 从 multistream_transformers 包中导入 MultistreamTrans
阅读全文
摘要:Lucidrains 系列项目源码解析(二十) .\lucidrains\imagen-pytorch\imagen_pytorch\imagen_pytorch.py # 导入数学库 import math # 从随机模块中导入随机函数 from random import random # 从
阅读全文
摘要:Lucidrains 系列项目源码解析(二) .\lucidrains\alphafold2\scripts\refinement.py # 导入所需的库和模块 import os import json import warnings # 科学计算库 import numpy as np # 尝试
阅读全文
摘要:Lucidrains 系列项目源码解析(八) .\lucidrains\DALLE-pytorch\setup.py # 导入设置工具和查找包工具 from setuptools import setup, find_packages # 执行版本文件中的代码,将版本信息导入当前环境 exec(op
阅读全文
摘要:SymPy 1.13 中文文档(一) 原文:docs.sympy.org/latest/index.html 安装 原文:docs.sympy.org/latest/install.html SymPy CAS 可以安装在几乎任何安装了 Python 的计算机上。SymPy 需要首先安装 mpmat
阅读全文
摘要:SymPy 1.13 中文文档(五) 原文:docs.sympy.org/latest/index.html 置换群 原文:docs.sympy.org/latest/modules/combinatorics/perm_groups.html class sympy.combinatorics.p
阅读全文
摘要:SymPy 1.13 中文文档(四) 原文:docs.sympy.org/latest/index.html 精炼 原文:docs.sympy.org/latest/modules/assumptions/refine.html sympy.assumptions.refine.refine(exp
阅读全文
摘要:SymPy 1.13 中文文档(十一) 原文:docs.sympy.org/latest/index.html 离散 原文链接:docs.sympy.org/latest/modules/discrete.html 在 SymPy 的discrete模块中实现了计算有限序列的离散变换和卷积的方法。
阅读全文
摘要:SymPy 1.13 中文文档(十五) 原文:docs.sympy.org/latest/index.html 物理 原文:docs.sympy.org/latest/reference/public/physics/index.html 一个帮助解决物理问题的模块。 目录 氢波函数 矩阵 泡利代数
阅读全文
摘要:SymPy 1.13 中文文档(十四) 原文:docs.sympy.org/latest/index.html 矢量积分的应用 原文:docs.sympy.org/latest/modules/vector/vector_integration.html 要在区域上积分一个标量或矢量场,我们必须首先
阅读全文
摘要:SymPy 1.13 中文文档(十三) 原文:docs.sympy.org/latest/index.html 矩阵类别 原文链接:docs.sympy.org/latest/modules/matrices/kind.html class sympy.matrices.kind.MatrixKin
阅读全文
摘要:SymPy 1.13 中文文档(十七) 原文:docs.sympy.org/latest/index.html Kane 方法与 Lagrange 方法(文档字符串) 原文链接:docs.sympy.org/latest/modules/physics/mechanics/api/kane_lagr
阅读全文
摘要:SymPy 1.13 中文文档(十六) 原文:docs.sympy.org/latest/index.html 运动学(文档字符串) 原文:docs.sympy.org/latest/modules/physics/vector/api/kinematics.html class sympy.phy
阅读全文
摘要:SymPy 1.13 中文文档(十九) 原文:docs.sympy.org/latest/index.html State 原文:docs.sympy.org/latest/modules/physics/quantum/state.html 状态的 Dirac 符号表示法。 class sympy
阅读全文
摘要:SymPy 1.13 中文文档(十二) 原文:docs.sympy.org/latest/index.html 集合 原文:docs.sympy.org/latest/modules/sets.html 基本集合 class sympy.sets.sets.Set(*args) 任何种类集合的基类。
阅读全文
摘要:SymPy 1.13 中文文档(十八) 原文:docs.sympy.org/latest/index.html 生物力学 原文:docs.sympy.org/latest/modules/physics/biomechanics/index.html Introduction 生物力学模型通常涉及同
阅读全文
摘要:SymPy 1.13 中文文档(十) 原文:docs.sympy.org/latest/index.html Solveset 原文链接:docs.sympy.org/latest/modules/solvers/solveset.html 这是solvers中solveset模块的官方文档。它包含
阅读全文
摘要:SymPy 1.13 中文文档(三十) 原文:docs.sympy.org/latest/index.html 贡献 原文链接:docs.sympy.org/latest/contributing/index.html 贡献指南详细介绍了如何为 SymPy 做贡献。 如果您是 SymPy 的新贡献者
阅读全文
摘要:SymPy 1.13 中文文档(三) 原文:docs.sympy.org/latest/index.html 单变量代数系统的一个或一组不等式简化 原文:docs.sympy.org/latest/guides/solving/reduce-inequalities-algebraically.ht
阅读全文
摘要:SymPy 1.13 中文文档(七) 原文:docs.sympy.org/latest/index.html 积分 原文:docs.sympy.org/latest/modules/integrals/index.html 本模块文档包含有关梅耶尔 G 函数和 SymPy 积分的详细信息。 内容 使
阅读全文
摘要:SymPy 1.13 中文文档(六) 原文:docs.sympy.org/latest/index.html 多周期群 原文:docs.sympy.org/latest/modules/combinatorics/pc_groups.html 介绍 本模块展示了用于计算多周期群(简称 PcGroup
阅读全文
摘要:SymPy 1.13 中文文档(九) 原文:docs.sympy.org/latest/index.html 不等式求解器 原文:docs.sympy.org/latest/modules/solvers/inequalities.html 对于一般情况应使用reduce_inequalities(
阅读全文
摘要:SymPy 1.13 中文文档(二十一) 原文:docs.sympy.org/latest/index.html Codegen 原文链接:docs.sympy.org/latest/modules/utilities/codegen.html 此模块提供功能,可以从 SymPy 表达式直接生成可编
阅读全文
摘要:SymPy 1.13 中文文档(二十五) 原文:docs.sympy.org/latest/index.html AGCA - 代数几何和交换代数模块 原文链接:docs.sympy.org/latest/modules/polys/agca.html 简介 代数几何是两种地中海文化理念的融合。它是
阅读全文
摘要:SymPy 1.13 中文文档(二十四) 原文:docs.sympy.org/latest/index.html 多项式操作 原始文档:docs.sympy.org/latest/modules/polys/index.html 多项式计算是计算机代数的核心,拥有快速且健壮的多项式操作模块是构建强大
阅读全文
摘要:SymPy 1.13 中文文档(二十三) 原文:docs.sympy.org/latest/index.html 曲线 原文链接:docs.sympy.org/latest/modules/geometry/curves.html class sympy.geometry.curve.Curve(f
阅读全文
摘要:SymPy 1.13 中文文档(二十七) 原文:docs.sympy.org/latest/index.html 多项式级数操作 原文链接:docs.sympy.org/latest/modules/polys/ringseries.html 任何有限的泰勒级数在实际应用中实际上都是多项式。本模块利
阅读全文
摘要:SymPy 1.13 中文文档(二十六) 原文:docs.sympy.org/latest/index.html 多项式操作模块的内部结构 原文链接:docs.sympy.org/latest/modules/polys/internals.html 多项式模块的实现在内部结构上被划分为“级别”。有
阅读全文
摘要:SymPy 1.13 中文文档(二十九) 原文:docs.sympy.org/latest/index.html 微分几何 原文:docs.sympy.org/latest/modules/diffgeom.html 介绍 基类参考 class sympy.diffgeom.Manifold(nam
阅读全文
摘要:SymPy 1.13 中文文档(二十二) 原文:docs.sympy.org/latest/index.html 打印 原文链接:docs.sympy.org/latest/modules/printing.html 请参阅教程中的 Printing 部分,了解有关打印的介绍。 本指南记录了 Sym
阅读全文
摘要:SymPy 1.13 中文文档(二十八) 原文:docs.sympy.org/latest/index.html 数域 原文链接:docs.sympy.org/latest/modules/polys/numberfields.html 引言 像代数数论中许多其他计算一样,有理素数的分裂只能用有理方
阅读全文
摘要:SymPy 1.13 中文文档(二十) 原文:docs.sympy.org/latest/index.html 控制系统绘图 原文:docs.sympy.org/latest/modules/physics/control/control_plots.html 该模块包含用于控制系统中一些常见绘图的
阅读全文
摘要:SymPy 1.13 中文文档(二) 原文:docs.sympy.org/latest/index.html 指南 原文:docs.sympy.org/latest/guides/index.html 指南是关于如何执行特定任务的逐步说明。 对于其他 SymPy 主题的深入详尽探索,请参阅 解释 和
阅读全文
摘要:SymPy 1.13 中文文档(八) 原文:docs.sympy.org/latest/index.html 形式幂级数 原文:docs.sympy.org/latest/modules/series/formal.html 计算和操作形式幂级数的方法。 class sympy.series.for
阅读全文
摘要:SciPy 1.12 中文文档(一) 原文:docs.scipy.org/doc/scipy-1.12.0/index.html SciPy 用户指南 原文:docs.scipy.org/doc/scipy-1.12.0/tutorial/index.html SciPy 是一组建立在NumPy之上
阅读全文
摘要:SciPy 1.12 中文文档(五) 原文:docs.scipy.org/doc/scipy-1.12.0/index.html scipy.integrate.complex_ode 原文链接:docs.scipy.org/doc/scipy-1.12.0/reference/generated/
阅读全文
摘要:SciPy 1.12 中文文档(四) 原文:docs.scipy.org/doc/scipy-1.12.0/index.html scipy.fftpack.dstn 原文:docs.scipy.org/doc/scipy-1.12.0/reference/generated/scipy.fftpa
阅读全文
摘要:SciPy 1.12 中文文档(十一) 原文:docs.scipy.org/doc/scipy-1.12.0/index.html scipy.optimize.linprog_verbose_callback 原文:docs.scipy.org/doc/scipy-1.12.0/reference
阅读全文
摘要:SciPy 1.12 中文文档(十五) 原文:docs.scipy.org/doc/scipy-1.12.0/index.html scipy.sparse.bsr_array 原文:docs.scipy.org/doc/scipy-1.12.0/reference/generated/scipy.
阅读全文
摘要:SciPy 1.12 中文文档(十四) 原文:docs.scipy.org/doc/scipy-1.12.0/index.html scipy.signal.zpk2ss 原文:docs.scipy.org/doc/scipy-1.12.0/reference/generated/scipy.sig
阅读全文
摘要:SciPy 1.12 中文文档(十三) 原文:docs.scipy.org/doc/scipy-1.12.0/index.html scipy.signal.invresz 原文:docs.scipy.org/doc/scipy-1.12.0/reference/generated/scipy.si
阅读全文
摘要:SciPy 1.12 中文文档(十七) 原文:docs.scipy.org/doc/scipy-1.12.0/index.html scipy.special.wright_bessel 原文链接:docs.scipy.org/doc/scipy-1.12.0/reference/generated
阅读全文
摘要:SciPy 1.12 中文文档(十六) 原文:docs.scipy.org/doc/scipy-1.12.0/index.html scipy.spatial.ConvexHull 原文链接:docs.scipy.org/doc/scipy-1.12.0/reference/generated/sc
阅读全文
摘要:SciPy 1.12 中文文档(十九) 原文:docs.scipy.org/doc/scipy-1.12.0/index.html scipy.special.boxcox 原文链接:docs.scipy.org/doc/scipy-1.12.0/reference/generated/scipy.
阅读全文
摘要:SciPy 1.12 中文文档(十二) 原文:docs.scipy.org/doc/scipy-1.12.0/index.html scipy.signal.cubic 原文:docs.scipy.org/doc/scipy-1.12.0/reference/generated/scipy.sign
阅读全文
摘要:SciPy 1.12 中文文档(十八) 原文:docs.scipy.org/doc/scipy-1.12.0/index.html scipy.special.fdtr 原文:docs.scipy.org/doc/scipy-1.12.0/reference/generated/scipy.spec
阅读全文
摘要:SciPy 1.12 中文文档(十) 原文:docs.scipy.org/doc/scipy-1.12.0/index.html scipy.optimize.OptimizeResult 原文链接:docs.scipy.org/doc/scipy-1.12.0/reference/generate
阅读全文
摘要:SciPy 1.12 中文文档(三十一) 原文:docs.scipy.org/doc/scipy-1.12.0/index.html SciPy 1.5.4 版本发布说明 原文链接:docs.scipy.org/doc/scipy-1.12.0/release/1.5.4-notes.html 内容
阅读全文
摘要:SciPy 1.12 中文文档(三十四) 原文:docs.scipy.org/doc/scipy-1.12.0/index.html SciPy 0.10.1 发布说明 原文链接:docs.scipy.org/doc/scipy-1.12.0/release/0.10.1-notes.html 内容
阅读全文
摘要:SciPy 1.12 中文文档(三十三) 原文:docs.scipy.org/doc/scipy-1.12.0/index.html SciPy 0.17.1 发布说明 原文链接:docs.scipy.org/doc/scipy-1.12.0/release/0.17.1-notes.html Sc
阅读全文
摘要:SciPy 1.12 中文文档(三十二) 原文:docs.scipy.org/doc/scipy-1.12.0/index.html SciPy 1.2.2 发布说明 原文链接:docs.scipy.org/doc/scipy-1.12.0/release/1.2.2-notes.html 目录 S
阅读全文
摘要:SciPy 1.12 中文文档(三十) 原文:docs.scipy.org/doc/scipy-1.12.0/index.html SciPy 1.8.1 发布说明 原文链接:docs.scipy.org/doc/scipy-1.12.0/release/1.8.1-notes.html 内容 Sc
阅读全文