Udacity深度学习(google)笔记(2)——深度神经网络, tensorflow

来源:互联网 发布:linux yum 安装 jdk 编辑:程序博客网 时间:2024/06/06 00:32
  • tensorflow的基本用法(不难,但是还是需要不时查阅文档,后续尝试下keras)
  • 反向传播,常见的教材都有推导
  • 任务2: 使用梯度下降和随机梯度下降训练一个全连接网络
  • axis=0是对列的操作
  • 看着下面的代码应该能想象出上次笔记中的那张xW+b的图(图形化的记忆和理解):
  •   # Variables.  weights = tf.Variable(    tf.truncated_normal([image_size * image_size, num_labels]))  biases = tf.Variable(tf.zeros([num_labels]))


  • epoch:随机的batch全部过一遍,每过一个batch是一个iteration
  • one epoch = numbers of iterations = N = 训练样本的数量/batch size  
  • 下面这段代码,注意是怎么循环使用所有样本的,因为一个epoch下来offset不一定刚好将样本数目全用完了:
  • num_steps = 3001for step in range(num_steps):    # Pick an offset within the training data, which has been randomized.    # Note: we could use better randomization across epochs.    offset = (step * batch_size) % (train_labels.shape[0] - batch_size)  #不见得刚好能“除尽”    # Generate a minibatch.    batch_data = train_dataset[offset:(offset + batch_size), :]    batch_labels = train_labels[offset:(offset + batch_size), :]


  • Turn the logistic regression example with SGD into a 1-hidden layer neural network with rectified linear units nn.relu() and 1024 hidden nodes:
  • 脑子里有图像很容易写出来,一个例子见http://blog.csdn.net/wds2006sdo/article/details/53786922
  • 纵向扩展深度而不是横向扩展广度
  • 我们使用很大(过大)的网络
  • Early Termination
  • 用正则化来对付过拟合: L2, Dropout (总结了多种正则化方法:http://blog.csdn.net/liujiandu101/article/details/55103831)
  • 任务 3: 正则化: 使用正则化去优化深度学习模型
  • http://www.hankcs.com/ml/task-3-regularization.html
  • 各层的L2正则项最后一起加在loss上?(找个教材推导推导)
  • 权值矩阵随机初始化的方差怎么确定,还有其他各种调参技术还需要练习和总结
阅读全文
0 0
原创粉丝点击