Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/InsaneLife/dssm
/ functions
Functions
205 in github.com/InsaneLife/dssm
⨍
Functions
205
◇
Types & classes
16
↳
Endpoints
1
↓ 1 callers
Method
predict
(self, test_data)
model/bert_classifier.py:137
↓ 1 callers
Function
predict_bert
(file_="./results/input/test")
train.py:114
↓ 1 callers
Method
predict_embedding
(self, test_data)
model/siamese_network.py:364
↓ 1 callers
Function
predict_siamese
(file_='./results/')
train.py:43
↓ 1 callers
Function
predict_siamese_bert
(file_="./results/input/test")
train.py:77
↓ 1 callers
Function
pull_batch
(data_map, batch_id)
dssm_rnn.py:161
↓ 1 callers
Function
pull_batch
(data_map, batch_id)
dssm.py:207
↓ 1 callers
Method
run_epoch
(self, epoch, data_train, data_val)
model/siamese_network.py:215
↓ 1 callers
Method
save_session
(self)
model/base_model.py:165
↓ 1 callers
Function
siamese_bert_sentence_embedding
(file_="./results/input/test.single")
train.py:131
↓ 1 callers
Method
to_dict
Serializes this instance to a Python dictionary.
model/bert/modeling_v1.py:95
↓ 1 callers
Method
to_dict
Serializes this instance to a Python dictionary.
model/bert/modeling.py:95
↓ 1 callers
Method
tokenize
(self, text)
model/bert/tokenization.py:113
↓ 1 callers
Function
train_bert
()
train.py:95
↓ 1 callers
Function
train_siamese
()
train.py:29
↓ 1 callers
Function
train_siamese_bert
()
train.py:58
↓ 1 callers
Function
transformer_model
Multi-headed, multi-layer Transformer from "Attention is All You Need". This is almost an exact implementation of the original Transformer encoder.
model/bert/modeling_v1.py:732
↓ 1 callers
Function
transformer_model
Multi-headed, multi-layer Transformer from "Attention is All You Need". This is almost an exact implementation of the original Transformer encoder.
model/bert/modeling.py:724
Method
__del__
(self)
model/base_model.py:140
Method
__init__
(self)
config.py:22
Method
__init__
(self, meta_file, max_len, allow_unk=0, unk="$UNK$", pad="$PAD$",)
data_input.py:21
Method
__init__
(self, cfg, is_training=1)
model/siamese_network.py:234
Method
__init__
(self, cfg, is_training=1)
model/base_model.py:130
Method
__init__
(self, cfg, is_training=1)
model/bert_classifier.py:53
Method
__init__
Constructs BertConfig. Args: vocab_size: Vocabulary size of `inputs_ids` in `BertModel`. hidden_size: Size of the encoder layers an
model/bert/modeling_v1.py:33
Method
__init__
Constructor for BertModel. Args: config: `BertConfig` instance. is_training: bool. rue for training model, false for eval model. Co
model/bert/modeling_v1.py:124
Method
__init__
(self, vocab_file, do_lower_case=True)
model/bert/tokenization.py:108
Method
__init__
(self, vocab_file, do_lower_case=True)
model/bert/tokenization.py:128
Method
__init__
Constructs a BasicTokenizer. Args: do_lower_case: Whether to lower case the input.
model/bert/tokenization.py:149
Method
__init__
(self, vocab, unk_token="[UNK]", max_input_chars_per_word=100)
model/bert/tokenization.py:264
Method
__init__
Constructs a AdamWeightDecayOptimizer.
model/bert/optimization.py:87
Method
__init__
Constructs BertConfig. Args: vocab_size: Vocabulary size of `inputs_ids` in `BertModel`. hidden_size: Size of the encoder layers an
model/bert/modeling.py:33
Method
__init__
Constructor for BertModel. Args: config: `BertConfig` instance. is_training: bool. rue for training model, false for eval model. Co
model/bert/modeling.py:124
Method
__len__
(self)
data_input.py:149
Method
_add_word_embedding_matrix
(self,)
model/base_model.py:290
Method
_bigru
(self, input_emb, input_length, hidden_size, variable_scope="BiGRU")
model/base_model.py:398
Method
_bilstm
(self, input_emb, input_length, hidden_size, variable_scope="BilSTM")
model/base_model.py:406
Method
_concat_lstm
input_emb: [batch_size, nstep, hidden_size] extra_emb: [batch_size, hidden_size]
model/base_model.py:248
Method
_dropout
(self, input_emb, ratio=None)
model/base_model.py:390
Method
_get_triplet_mask
得到一个3D的mask [a, p, n], 对应triplet(a, p, n)是valid的位置是True ---------------------------------- Args: labels: 对应训练数据的l
model/base_model.py:55
Method
_iterable_dilated_cnn
:param embeddings: [batch_size, steps, embedding_dim] :return:
model/base_model.py:416
Method
_pairwise_distance
计算两两embedding的距离 ------------------------------------------ Args: embedding: 特征向量, 大小(batch_size, vector_size)
model/base_model.py:28
Method
_state_lstm
(self, input_emb, input_length, initial_state, hidden_size, variable_scope="StateLSTM")
model/base_model.py:231
Method
_train_op
(self)
model/base_model.py:271
Method
_transform_intent2ont_hot
(self, words, padding=0)
data_input.py:81
Function
_truncate_seq_pair
Truncates a sequence pair in place to the maximum length.
util.py:47
Method
add_bert_layer
(self, use_bert_pre=1)
model/base_model.py:304
Method
apply_dropout
()
model/bert/modeling_v1.py:157
Method
batch_all_triplet_loss
triplet loss of a batch ------------------------------- Args: labels: 标签数据,shape = (batch_size,)
model/base_model.py:88
Function
batch_normalization
Batch normalization on convolutional maps. Ref.: http://stackoverflow.com/questions/33949786/how-could-i-use-batch-normalization-in-tensorflo
multi_view_dssm_v3.py:62
Method
build
(self)
model/siamese_network.py:295
Method
build
(self)
model/bert_classifier.py:86
Function
contrastive_loss
(y, d, batch_size)
dssm.py:99
Method
contrastive_loss
(self, model1, model2, y, margin=0.5)
model/siamese_network.py:271
Function
convert_to_unicode
Converts `text` to Unicode (if it's not already), assuming utf-8 input.
util.py:15
Method
convert_tokens_to_ids
(self, tokens)
model/bert/tokenization.py:121
Method
convert_tokens_to_ids
(self, tokens)
model/bert/tokenization.py:142
Method
cos_sim
(self, query_rnn_output, doc_rnn_output)
model/siamese_network.py:99
Function
cosine_similarity
(a, b)
model/siamese_network.py:32
Function
cosine_similarity
(a, b)
model/bert_classifier.py:31
Function
create_optimizer
Creates an optimizer training op.
model/bert/optimization.py:25
Method
from_json_file
Constructs a `BertConfig` from a json file of parameters.
model/bert/modeling_v1.py:89
Function
gelu
Gaussian Error Linear Unit. This is a smoother version of the RELU. Original paper: https://arxiv.org/abs/1606.08415 Args: input_tensor:
model/bert/modeling_v1.py:263
Function
gelu
Gaussian Error Linear Unit. This is a smoother version of the RELU. Original paper: https://arxiv.org/abs/1606.08415 Args: input_tensor:
model/bert/modeling.py:255
Function
gen_word_set
(file_path, out_path='./data/words.txt')
data_input.py:171
Method
get_all_encoder_layers
(self)
model/bert/modeling_v1.py:246
Method
get_all_encoder_layers
(self)
model/bert/modeling.py:238
Function
get_assignment_map_from_checkpoint
Compute the union of the current variables and checkpoint variables.
model/bert/modeling_v1.py:310
Function
get_assignment_map_from_checkpoint
Compute the union of the current variables and checkpoint variables.
model/bert/modeling.py:302
Function
get_data
gen datasets, convert word into word ids. :param file_path: :return: [[query, pos sample, 4 neg sample]], shape = [n, 6]
data_input.py:215
Function
get_data_bow
gen datasets, convert word into word ids. :param file_path: :return: [[query, prefix, label]], shape = [n, 3]
data_input.py:269
Function
get_data_siamese_rnn
gen datasets, convert word into word ids. :param file_path: :return: [[query, pos sample, 4 neg sample]], shape = [n, 6]
data_input.py:250
Method
get_embedding_output
Gets output of the embedding lookup (i.e., input to the transformer). Returns: float Tensor of shape [batch_size, seq_length, hidden_size]
model/bert/modeling_v1.py:249
Method
get_embedding_output
Gets output of the embedding lookup (i.e., input to the transformer). Returns: float Tensor of shape [batch_size, seq_length, hidden_size]
model/bert/modeling.py:241
Method
get_embedding_table
(self)
model/bert/modeling_v1.py:259
Method
get_embedding_table
(self)
model/bert/modeling.py:251
Function
get_lcqmc_bert
使用LCQMC数据集,并将每个query其转为word_id,
data_input.py:337
Method
get_params_count
()
model/base_model.py:177
Method
get_pooled_output
(self)
model/bert/modeling_v1.py:235
Method
get_sequence_output
Gets final hidden layer of encoder. Returns: float Tensor of shape [batch_size, seq_length, hidden_size] corresponding to the final
model/bert/modeling_v1.py:238
Function
get_test_bert
(file_:str, vocab:Vocabulary, is_merge=0)
data_input.py:363
Function
get_test_bert_single
(file_:str, vocab:Vocabulary, is_merge=0)
data_input.py:384
Function
hello_world
(q1, q2)
flask_server.py:29
Method
init_from_pre_dir
(self, pre_dir)
model/base_model.py:170
Method
label_smoothing
From the paper: "... employed label smoothing of epsilon = 0.1. This hurts perplexity, as the model learns to be more unsure, but imp
model/base_model.py:497
Function
mean_var_with_update
()
multi_view_dssm_v3.py:82
Function
mean_var_with_update
(ema, fc_mean, fc_var)
dssm.py:48
Method
not_apply_dropout
()
model/bert/modeling_v1.py:153
Function
printable_text
Returns text encoded in a way suitable for print or `tf.logging`.
model/bert/tokenization.py:47
Function
pull_all
(query_in, doc_positive_in, doc_negative_in)
dssm.py:187
Method
run_epoch
(self, epoch, d_train, d_val)
model/siamese_network.py:321
Method
run_epoch
(self, epoch, d_train, d_val)
model/bert_classifier.py:106
Function
siamese_loss
(out1,out2,y,Q=5)
model/siamese_network.py:40
Method
siamese_loss
(self, out1, out2, y, Q=5.0)
model/siamese_network.py:263
Method
to_json_string
Serializes this instance to a JSON string.
model/bert/modeling_v1.py:100
Method
to_json_string
Serializes this instance to a JSON string.
model/bert/modeling.py:100
Method
tokenize
(self, text)
model/bert/tokenization.py:134
Method
tokenize
Tokenizes a piece of text.
model/bert/tokenization.py:157
Method
tokenize
Tokenizes a piece of text into its word pieces. This uses a greedy longest-match-first algorithm to perform tokenization using the
model/bert/tokenization.py:269
Method
transform
(self, seq_list, is_bert=0)
data_input.py:143
← previous
next →
101–200 of 205, ranked by callers