charmpeng

Results 5 issues of charmpeng

在effective-tf.md中定义模型函数的时候, ```py import numpy as np import TensorFlow as tf x = tf.placeholder(tf.float32) y = tf.placeholder(tf.float32) w = tf.get_variable("w", shape=[3, 1]) f = tf.stack([tf.square(x), x, tf.ones_like(x)], 1) yhat = tf.squeeze(tf.matmul(f,...

``` def _single_style_loss(self, a, g): ############################### ## TO DO N = a.shape[3] M = a.shape[1] * a.shape[2] gram_a = self._gram_matrix(a, N, M) gram_g = self._gram_matrix(g, N, M) return tf.reduce_sum((gram_g -...

这个代码的主要目的是预测下一个char。 ``` def sample(self, n_samples, prime, vocab_size): samples = [c for c in prime] sess = self.session new_state = sess.run(self.initial_state) preds = np.ones((vocab_size, )) # for prime=[] for c in...

up主你好,我看了下代码,了解了model的大致框架。不太明白为何有一个pre_train的过程,是为了给模型的参数一个初始化么?

train.py里的dev_step, 第173行,在做dev时,也用了train_step,这导致了log文件里,每100步做一次dev,但后续的train里,step数都是n+20开始,而不是从n+1开始。