1 Star 0 Fork 0

painx/WZCQ

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
config.py 1.60 KB
一键复制 编辑 原始数据 按行查看 历史
冯泉荔 提交于 2021-07-05 00:13 . Add files via upload
class GPT2Config(object):
def __init__(
self,
vocab_size_or_config_json_file=12491,
n_positions=1024,
n_ctx=512,
n_embd=768,
n_layer=6,
n_head=6,
layer_norm_epsilon=1e-5,
initializer_range=0.02,
):
self.vocab_size = vocab_size_or_config_json_file
self.n_ctx = n_ctx
self.n_positions = n_positions
self.n_embd = n_embd
self.n_layer = n_layer
self.n_head = n_head
self.layer_norm_epsilon = layer_norm_epsilon
self.initializer_range = initializer_range
class TransformerConfig(object):
def __init__(
self,
d_model=768,
n_layers=12,
heads=12,
dropout=0.0,
load_weights='weights'
):
self.d_model = d_model
self.n_layers = n_layers
self.heads = heads
self.dropout = dropout
self.load_weights = load_weights
class GPT2Config(object):
def __init__(
self,
vocab_size_or_config_json_file=12491,
n_positions=1024,
n_ctx=1024,
n_embd=768,
n_layer=12,
n_head=12,
layer_norm_epsilon=1e-5,
initializer_range=0.02,
):
self.vocab_size = vocab_size_or_config_json_file
self.n_ctx = n_ctx
self.n_positions = n_positions
self.n_embd = n_embd
self.n_layer = n_layer
self.n_head = n_head
self.layer_norm_epsilon = layer_norm_epsilon
self.initializer_range = initializer_range
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/painx/WZCQ.git
git@gitee.com:painx/WZCQ.git
painx
WZCQ
WZCQ
main

搜索帮助