- 博客(5)
- 收藏
- 关注
原创 pytorch_practice_model
import copy import numpy as np import torch import torch.nn.functional as F from torch import nn START_TAG = "START" STOP_TAG = "STOP" def log_sum_exp(vec): max_score = torch.max(vec...
2019-02-22 08:59:35 169
原创 pytorch_practice_data manager
import copy import pickle as cPickle import torch class DataManager(): def __init__(self, max_length=100, batch_size=20, data_type='train', tags=[]): self.index = 0 self.in...
2019-02-22 08:58:36 205
原创 pytorch_practice_main
举例 # -*- coding:utf-8 -*- import pickle import sys import yaml import torch import torch.optim as optim from data_manager import DataManager from model import BiLSTMCRF from utils import f1_score...
2019-02-22 08:47:20 248
原创 train model
Train your experiment. Simply run python train.py --data_dir data/small --model_dir experiments/base_model It will instantiate a model and train it on the training set following the hyperparamet...
2019-02-21 08:40:56 751 2
原创 build vocab
"""Build vocabularies of words and tags from datasets""" import argparse from collections import Counter import json import os parser = argparse.ArgumentParser() parser.add_argument('--min_count_w...
2019-02-20 08:50:10 2263
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人