MCPcopy Create free account

hub / github.com/DarLiner/Algorithm_Interview_Notes-Chinese / functions

Functions66 in github.com/DarLiner/Algorithm_Interview_Notes-Chinese

↓ 9 callersFunctionget_wb
(shape, w_initializer=truncated_normal, b_initializer=zeros, w_regularizer=l2
_codes/my_tensorflow/src/utils/__init__.py:39
↓ 6 callersFunctionsoftmax
Examples: n_dim = x.get_shape().ndims assert n_dim >= 2 if n_dim == 2: return tf.nn.softmax(x) else:
_codes/my_tensorflow/src/activations/__init__.py:49
↓ 3 callersFunctionget_shape
References: tflearn.utils.get_incoming_shape
_codes/my_tensorflow/src/utils/__init__.py:26
↓ 3 callersFunctionget_w
(shape, w_initializer=truncated_normal, w_regularizer=l2_regularizer, name=None)
_codes/my_tensorflow/src/utils/__init__.py:54
↓ 2 callersFunctiondense
全连接层 Input shape: [batch_size, n_input] Output shape: [batch_size, n_unit] 如果需要 reuse 推荐使用类实现的 `Dense` Args: x(tf.Tensor):
_codes/my_tensorflow/src/layers/dense.py:15
↓ 2 callersFunctionget_params_dict
以字典形式获取所有 trainable 参数
_codes/my_tensorflow/src/utils/__init__.py:64
↓ 2 callersFunctionload_data
加载数据 源数据格式为多行,每行为两个浮点数,分别表示 (x,y)
_codes/machine_learning/KMeans/kmeans.py:11
↓ 2 callersFunctionpermute
Examples: x.shape == [128, 32, 1] x = permute(x, [0, 2, 1]) x.shape == [128, 1, 32] y.shape == [128, 64, 32]
_codes/my_tensorflow/src/utils/array_op.py:12
↓ 2 callersMethodprint
_codes/cpp/面向对象-不通过继承实现多态-动态序列.cpp:29
↓ 2 callersFunctionrand_center
随机采样 k 个样本作为聚类中心
_codes/machine_learning/KMeans/kmeans.py:30
↓ 2 callersFunctionsigmoid
(x)
_codes/my_tensorflow/src/activations/__init__.py:16
↓ 2 callersFunctionword_clean
单词清洗
_codes/model/倒排索引/inverse_index.py:23
↓ 1 callersMethod_build
(self, n_input)
_codes/my_tensorflow/src/layers/dense.py:81
↓ 1 callersMethod_call
(self, x)
_codes/my_tensorflow/src/layers/dense.py:86
↓ 1 callersFunctioncreate_inverse_index
对给定文件列表构建倒排索引
_codes/model/倒排索引/inverse_index.py:30
↓ 1 callersFunctionget_params_number
获取参数总量
_codes/my_tensorflow/src/utils/__init__.py:87
↓ 1 callersFunctionhighway_conv2d
用于 conv2d 的 highway Input shape: [batch_size, in_h, in_w, in_channels] Output shape: [batch_size, in_h, in_w, in_channels] 公式 `o
_codes/my_tensorflow/src/layers/highway.py:51
↓ 1 callersFunctionhighway_dense
用于全连接层的 highway Input shape: [batch_size, n_input] Output shape: [batch_size, n_input] 公式 `o = H(x, W)T(x, W) + x(1 - T(x, W))`
_codes/my_tensorflow/src/layers/highway.py:15
↓ 1 callersFunctionk_means
K-Means 算法 一般 K-Mean 算法的终止条件有如下几个: 1. 所有样本的类别不再改变 2. 达到最大迭代次数 3. 精度达到要求(?) 返回聚类中心及聚类结果
_codes/machine_learning/KMeans/kmeans.py:36
↓ 1 callersFunctionleaky_relu
渗透 ReLU `o = max(alpha * x, x)`
_codes/my_tensorflow/src/activations/relu.py:28
↓ 1 callersFunctionprinty
Args: ret(dict): Returns:
_codes/model/倒排索引/inverse_index.py:108
↓ 1 callersFunctionscore_euclidean
计算两个点之间的欧式距离
_codes/machine_learning/KMeans/kmeans.py:24
↓ 1 callersFunctionsearch
Args: txt(str): inverse_index(dict): word_freq(dict): Returns: dict
_codes/model/倒排索引/inverse_index.py:81
↓ 1 callersFunctionsearch_tokens
(tokens, inverse_index, word_freq=None)
_codes/model/倒排索引/inverse_index.py:70
↓ 1 callersMethodset_sequence
调整指针指向
_codes/cpp/面向对象-不通过继承实现多态-动态序列.cpp:19
↓ 1 callersMethodsquare
_codes/cpp/面向对象-不通过继承实现多态-动态序列.cpp:42
Method__call__
Args: x: 注意 x.dtype == float32
_codes/my_tensorflow/src/regularizers/L1L2.py:28
Method__call__
(self, x)
_codes/my_tensorflow/src/layers/dense.py:91
Method__init__
Args: l1(float): L1 正则化的系数 l2(float): L2 正则化的系数
_codes/my_tensorflow/src/regularizers/L1L2.py:19
Method__init__
(self, n_unit, act_fn=relu, name=None)
_codes/my_tensorflow/src/layers/dense.py:73
Function_test
()
_codes/machine_learning/KMeans/kmeans.py:87
Functionattention_flow
Attention Flow Match Layer Input shape: h: [N, T, d] # 原文中的 shape 为 [N, T, 2d], 因为经过了 bi-LSTM, 维度扩了一倍 u: [N, J, d] Output sha
_codes/my_tensorflow/src/layers/match/attention_flow.py:62
Functionattention_flow_self
Attention Flow Self Match Layer Input shape: h: [N, T, d] # 原文中的 shape 为 [N, T, 2d], 因为经过了 bi-LSTM, 维度扩了一倍 u: [N, J, d] Outpu
_codes/my_tensorflow/src/layers/match/attention_flow.py:17
Functionattention_for_dense
Input shape: [batch_size, n_input] Output shape: [batch_size, n_input] 公式 `o = x * softmax(Wx + b)` 一般用法 ```
_codes/my_tensorflow/src/layers/attention.py:16
Functionattention_for_rnn
Input shape: [batch_size, n_step, n_input] Output shape: [batch_size, n_step, n_input] Examples: 以下示例使用了 TensorLayer 库来快速构建模型;本
_codes/my_tensorflow/src/layers/attention.py:41
Functionchar_cnn_embedding
In: [N, max_n_word, max_n_char] Out: [N, max_n_word, c_embed_size] max_n_word: 句子的最大长度 max_n_char: 单词的最大长度 Args: x:
_codes/my_tensorflow/src/layers/embedding/char_cnn.py:13
Functionclip_relu
截断 ReLU `o = min(max(0., x), max_value)`
_codes/my_tensorflow/src/activations/relu.py:35
Functionconv1d
()
_codes/my_tensorflow/src/layers/cnn.py:13
Functionconv2d
2-D 卷积层 Input shape: [batch_size, in_h, in_w, in_channels] Output shape: [batch_size, out_h, out_w, out_channels] Args: x(tf.Ten
_codes/my_tensorflow/src/layers/cnn.py:17
Functioncrelu
Concatenated ReLU
_codes/my_tensorflow/src/activations/relu.py:22
Functiondot
Multiplies 2 tensors (and/or variables) and returns a *tensor*.
_codes/my_tensorflow/src/utils/math_op.py:10
Functionelu
指数线性单元
_codes/my_tensorflow/src/activations/__init__.py:65
Methodfibonacci
_pmf 可以指向以下任何一个函数
_codes/cpp/面向对象-不通过继承实现多态-动态序列.cpp:34
Functionfoo
()
_codes/my_tensorflow/src/utils/__init__.py:22
Functionget_vocab
(file_path)
_codes/my_nlp/src/utils/vocab.py:12
Functionget_w2v
提取词向量
_codes/my_nlp/src/utils/__init__.py:6
Functionhard_sigmoid
x = 0. x < -2.5 = 1. x > 2.5 = 0.2 * x + 0.5 otherwise
_codes/my_tensorflow/src/activations/__init__.py:21
Functionidentity
(x)
_codes/my_tensorflow/src/activations/__init__.py:11
Functionlinear
(x)
_codes/my_tensorflow/src/activations/__init__.py:6
Functionlinear_dense
线性全连接层 Input shape: [batch_size, n_input] Output shape: [batch_size, n_unit] Args: x(tf.Tensor): n_unit(int): na
_codes/my_tensorflow/src/layers/dense.py:56
Functionmain
_codes/cpp/面向对象-不通过继承实现多态-动态序列.cpp:58
Functionmulti_dense
多层全连接 Input shape: [batch_size, n_input] Output shape: [batch_size, n_unit_list[-1]] Args: x(tf.Tensor): n_unit_ls(list
_codes/my_tensorflow/src/layers/dense.py:37
Functionmulti_highway_conv2d
多层 highway_conv2d
_codes/my_tensorflow/src/layers/highway.py:89
Functionmulti_highway_dense
多层 highway_dense Input shape: [batch_size, n_input] Output shape: [batch_size, n_input]
_codes/my_tensorflow/src/layers/highway.py:39
Methodnum_sequence
构造函数:默认指向斐波那契数列
_codes/cpp/面向对象-不通过继承实现多态-动态序列.cpp:16
Functionparametric_relu
参数化 ReLU References: tflearn.prelu
_codes/my_tensorflow/src/activations/relu.py:44
Functionprint_params_dict
()
_codes/my_tensorflow/src/utils/__init__.py:73
Functionprint_params_number
()
_codes/my_tensorflow/src/utils/__init__.py:93
Functionrelu
ReLU `o = max(0., x)`
_codes/my_tensorflow/src/activations/relu.py:8
Functionrelu6
`o = min(max(x, 0), 6)`
_codes/my_tensorflow/src/activations/relu.py:15
Functionrepeat
Examples: x.shape == [batch_size, n_input] x = repeat(x, n_step) x.shape == [batch_size, n_step, n_input] References
_codes/my_tensorflow/src/utils/array_op.py:29
Functionselu
缩放型指数线性单元
_codes/my_tensorflow/src/activations/__init__.py:70
Functionset_vocab
(sentences, save_path=None)
_codes/my_nlp/src/utils/vocab.py:4
Functionsoftplus
(x)
_codes/my_tensorflow/src/activations/__init__.py:37
Functionsoftsign
o = x / (1 + abs(x))
_codes/my_tensorflow/src/activations/__init__.py:42
Functiontanh
(x)
_codes/my_tensorflow/src/activations/__init__.py:32