Regular Expression Patterns Regular Expression PatternsFollowing lists the regular expression syntax that is available in Python.PatternDescription^match beginning of the line.$match end of line..match a...
Theano printing Theano printingTo visualize the internal relation graph of theano variables.Installingconda install pydot graphvizadd graphviz path D:\Anaconda\Library\bin\graphvizto system PATH[windows ver...
Theano Graph Structure Graph StructureGraph Definitiontheano's symbolic mathematical computation, which is composed of:Apply node: the application of an operator to some variable.Variable node: symbolic varibles....
broadcasting Theano vs. Numpy broadcasting Theano vs. Numpybroadcast mechanism allows a scalar may be added to a matrix, a vector to a matrix or a scalar to a vecotor.ExamplesT and F stands for True and False respectively...
Theano Inplace Theano Inplaceinplace Computationcomputation that destroy their inputs as a side-effect.Exampleif you iterate over matrix and double every elements, this is an inplace operations.because whe...
theano scan optimization selected from Theano DocOptimizing Scan performanceMinimizing Scan Usageperforman as much of the computation as possible outside of Scan. This may have the effect increasing memory usage but a...
theano broadcasting 当我们使用函数对两个数组进行计算时,函数会对这两个数组的对应元素进行计算,因此它要求这两个数组有相同的大小(shape相同)。如果两个数组的shape不同的话,会进行如下的广播(broadcasting)处理:让所有输入数组都向其中shape最长的数组看齐,shape中不足的部分都通过在前面加1补齐输出数组的shape是输入数组shape的各个轴上的最大值如果输入数组的某个轴和输...
theano sparse_block_dot theano 中的一个函数 sparse_block_dot;Function:for b in range(batch_size): for j in range(o.shape[1]): for i in range(h.shape[1]): o[b, j, :] += numpy.dot(h[b, i], W[iIdx[b, i]...
theano .dimshuffle .dimshuffle改变输入维度的顺序,返回原始变量的一个view.输入是一个包含 \([0,1,...,ndim-1]\) 和任意数目的 \('x'\) 的组合:例如:\(('x')\):将标量变成 \(1\) 维数组\((0, 1)\):与原始的 \(2\) 维数组相同\((1, 0)\):交换 \(2\) 维数组的两个维度,形状从 \(N \times M\) 变 ...
vector - vector product the inner productGivens two vectors \(x,y\in \mathbb{R}^n\), the quantity \(x^\top y\), sometimes called the inner product or dot product of the vectors, is a real number given by:\[x^\top y=\b...
Noise Contrastive Estimation Notes from Notes on Noise Contrastive Estimation and Negative Samplingone sample:\[x_i \to [y_i^0,\cdots,y_{i}^{k}]\]where \(y_i^0\) are true labeled words , and \(y_i^1,\cdots,y_i^{k}\) are n...
Derivative of the softmax loss function Back-propagation in a nerual network with a Softmax classifier, which uses the Softmax function:\[\hat y_i=\frac{\exp(o_i)}{\sum_j \exp(o_j)}\]This is used in a loss function of the form:\[\ma...
Introduction to Neural Machine Translation - part 2 waiting for updating....转载于:https://www.cnblogs.com/ZJUT-jiangnan/p/5553201.html
Traditional Language Model Traditional Language Model通常用于回答下述问题:How likely is a string of English words good English ?\(p_{LM}(\)the house is small\()\ge p_{LM}(\) small the is house\()\)\(p_{LM}(\)I am going home\()\ge...
tensrflow python [defunct] 在ubuntu上面安装了GPU版本的tensorflow后,很容易碰到zombie thread 的问题,无法正常关闭tensorflow的线程,用ps aux|grep python可以看到python [defunct]表明这个python 的程序已经成为了zombie了,如果要杀死该进程,必须要kill 其parent 的进程。然而,不信的是我们发现PPID=1, 这个是系统...
Theano: CNMeM is disabled, CuDNN not available ProblemTheano: CNMeM is disabled, CuDNN not availableSolutioncnmem package: https://github.com/NVIDIA/cnmem% cd $HOME% git clone https://github.com/NVIDIA/cnmem.git cnmem% cd cnmem% mkdir ...
Perplexity Vs Cross-entropy Evaluating a Language Model: PerplexityWe have a serial of \(m\) sentences:\[s_1,s_2,\cdots,s_m\]We could look at the probability under our model \(\prod_{i=1}^m{p(s_i)}\). Or more convenientl...
Introduction to Neural Machine Translation - part 1 The Noise Channel Model\(p(e)\): the language Model\(p(f|e)\): the translation modelwhere, \(e\): English language; \(f\): French Language.由法语翻译成英语的概率:\[p(e|f)=\frac{p(e,f)}{p(f)}=\frac{p(e)...