• 大小: 468KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-01-09
  • 语言: Python
  • 标签: pytorch  机器翻译  

资源简介

PyTorch实现基于Transformer的神经机器翻译

资源截图

代码片段和文件信息

import datetime
import os
import time

import torch
from torch.nn.parallel.distributed import DistributedDataParallel as DDP

from squirrel.config import (get_config setup_cuda setup_dataloader
                             setup_datapath setup_pretrained_model)
from squirrel.data import get_dataloader
from squirrel.decoder import valid_model valid_model_ppl
from squirrel.learner import train_model
from squirrel.models import get_model
from squirrel.utils import Watcher count_parameters setup_random_seed

# all the hyper-parameters
START_TIME = time.time()

args = get_config(“Transformer-Squirrel“)
args = setup_cuda(args)
setup_random_seed(args.seed)
setup_datapath(args)

# setup watcher settings
watcher = Watcher(
    rank=args.local_rank
    log_path=os.path.join(args.workspace_pr

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2019-03-17 22:40  Squirrel-master\
     文件        6148  2019-03-17 22:40  Squirrel-master\.DS_Store
     文件        4728  2019-03-17 22:40  Squirrel-master\ez_run.py
     文件        7124  2019-03-17 22:40  Squirrel-master\run.py
     目录           0  2019-03-17 22:40  Squirrel-master\squirrel\
     文件        6148  2019-03-17 22:40  Squirrel-master\squirrel\.DS_Store
     文件           0  2019-03-17 22:40  Squirrel-master\squirrel\__init__.py
     目录           0  2019-03-17 22:40  Squirrel-master\squirrel\bert_models\
     文件         478  2019-03-17 22:40  Squirrel-master\squirrel\bert_models\__init__.py
     文件         932  2019-03-17 22:40  Squirrel-master\squirrel\bert_models\__main__.py
     文件        4478  2019-03-17 22:40  Squirrel-master\squirrel\bert_models\convert_tf_checkpoint_to_pytorch.py
     文件        8021  2019-03-17 22:40  Squirrel-master\squirrel\bert_models\file_utils.py
     文件       59603  2019-03-17 22:40  Squirrel-master\squirrel\bert_models\modeling.py
     文件        6803  2019-03-17 22:40  Squirrel-master\squirrel\bert_models\optimization.py
     文件       14404  2019-03-17 22:40  Squirrel-master\squirrel\bert_models\tokenization.py
     文件        3158  2019-03-17 22:40  Squirrel-master\squirrel\build_vocab.py
     目录           0  2019-03-17 22:40  Squirrel-master\squirrel\config\
     文件        9109  2019-03-17 22:40  Squirrel-master\squirrel\config\__init__.py
     文件         962  2019-03-17 22:40  Squirrel-master\squirrel\config\checkpoint_configuration.py
     文件        4096  2019-03-17 22:40  Squirrel-master\squirrel\config\data_configuration.py
     文件        9192  2019-03-17 22:40  Squirrel-master\squirrel\config\model_configuration.py
     文件        2319  2019-03-17 22:40  Squirrel-master\squirrel\config\train_configuration.py
     文件        1365  2019-03-17 22:40  Squirrel-master\squirrel\config\utils_configuration.py
     文件        2066  2019-03-17 22:40  Squirrel-master\squirrel\config\valid_configuration.py
     目录           0  2019-03-17 22:40  Squirrel-master\squirrel\data\
     文件         602  2019-03-17 22:40  Squirrel-master\squirrel\data\__init__.py
     文件       10475  2019-03-17 22:40  Squirrel-master\squirrel\data\batch.py
     文件       20917  2019-03-17 22:40  Squirrel-master\squirrel\data\data_loader.py
     文件        5497  2019-03-17 22:40  Squirrel-master\squirrel\data\datasets.py
     文件        3891  2019-03-17 22:40  Squirrel-master\squirrel\data\field.py
     文件        2678  2019-03-17 22:40  Squirrel-master\squirrel\data\noise.py
............此处省略37个文件信息

评论

共有 条评论