Skip to content
Snippets Groups Projects
Commit a7604991 authored by i-robot's avatar i-robot Committed by Gitee
Browse files

!1693 lstm_crf model dev

Merge pull request !1693 from sun_zhongqian/master
parents c34a4056 8683677d
No related branches found
No related tags found
No related merge requests found
......@@ -45,10 +45,10 @@ AdamWeightDecay:
preprocess: 'false'
data_CoNLL_path: "./data/CoNLL2000"
glove_path: "./data/glove"
preprocess_path: "/preprocess"
ckpt_path: 'lstm_crf-15_446.ckpt'
pre_trained: '' # None
device_num: 1
distribute: "false"
enable_graph_kernel: "true"
......@@ -57,6 +57,12 @@ ckpt_file: './ckpt_lstm/lstm_crf.ckpt'
file_name: "lstm_crf"
file_format: "MINDIR"
# LSTM_CRF Postprocess
label_dir: ''
result_dir: "./result_Files"
# preprocess
result_path: './preprocess_Result/'
---
# Config description for each option
......@@ -69,9 +75,10 @@ output_path: 'Training output path for local'
preprocess: 'whether to preprocess data.'
data_CoNLL_path: 'path where the dataset is stored.'
glove_path: 'path where the GloVe is stored.'
preprocess_path: 'path where the pre-process data is stored.'
ckpt_path: 'the path to save the checkpoint file.'
pre_trained: 'the pretrained checkpoint file path.'
device_target: 'the target device to run, support "GPU", "CPU". Default: "Ascend".'
device_target: 'the target device to run, "CPU". Default: "Ascend".'
device_num: 'Use device nums, default is 1.'
enable_graph_kernel: 'Accelerate by graph kernel, default is true.'
......
......@@ -25,13 +25,6 @@ STACK_LSTM_DEVICE = ["CPU"]
# Initialize short-term memory (h) and long-term memory (c) to 0
def lstm_default_state(batch_size, hidden_size, num_layers, bidirectional):
"""init default input."""
num_directions = 2 if bidirectional else 1
h = Tensor(np.zeros((num_layers * num_directions, batch_size, hidden_size)).astype(np.float32))
c = Tensor(np.zeros((num_layers * num_directions, batch_size, hidden_size)).astype(np.float32))
return h, c
def stack_lstm_default_state(batch_size, hidden_size, num_layers, bidirectional):
"""init default input."""
num_directions = 2 if bidirectional else 1
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment