资源简介

本例使用tensorflow框架实现深度学习模型,包括CNN、RNN、GAN等,有源码和数据

资源截图

代码片段和文件信息

# -*- coding: utf-8 -*-

import tensorflow as tf

# Variable定义了weights作为一个变量,传入的参数是该变量的值和名字
# random_normal的是产生高斯分布的随机变量,而给定参数分别是变量的维数,期望值,方差
weights = tf.Variable(tf.random_normal([2 2 3] mean=0 stddev=0.35) name=“weights“)

biases = tf.Variable(tf.zeros([200]) name=“biases“)

w_twice = tf.Variable(weights.initialized_value() * 2.0 name=“w_twice“)

# 我们定义了变量后,需要将所有变量初始化
# init_op = tf.global_variables_initializer()
# 我们只将部分变量初始化
init_op = tf.variables_initializer({weights w_twice})

with tf.Session() as sess:
    sess.run(init_op)
    print(“\n“)
    print(sess.run(weights))
    print(“\n“)
    print(sess.run(w_twice))



 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-08-28 09:43  learning-tensorflow-master\
     文件          48  2018-03-21 17:14  learning-tensorflow-master\.gitignore
     目录           0  2018-03-21 17:14  learning-tensorflow-master\lesson1\
     文件           5  2018-03-21 17:14  learning-tensorflow-master\lesson1\.gitignore
     文件         814  2018-03-21 17:14  learning-tensorflow-master\lesson1\creation.py
     文件         819  2018-03-21 17:14  learning-tensorflow-master\lesson1\save_restore.py
     文件        1576  2018-03-21 17:14  learning-tensorflow-master\lesson1\sharing_variable.py
     目录           0  2018-03-21 17:14  learning-tensorflow-master\lesson2\
     目录           0  2018-03-21 17:14  learning-tensorflow-master\lesson2\load_data\
     文件          30  2018-03-21 17:14  learning-tensorflow-master\lesson2\load_data\A.csv
     文件      516027  2018-03-21 17:14  learning-tensorflow-master\lesson2\load_data\AnimatedFileQueues.gif
     文件          24  2018-03-21 17:14  learning-tensorflow-master\lesson2\load_data\B.csv
     文件          24  2018-03-21 17:14  learning-tensorflow-master\lesson2\load_data\C.csv
     文件           0  2018-03-21 17:14  learning-tensorflow-master\lesson2\load_data\D.csv
     文件        1086  2018-03-21 17:14  learning-tensorflow-master\lesson2\load_data\iter_control.py
     文件         722  2018-03-21 17:14  learning-tensorflow-master\lesson2\load_data\readers_samples.py
     文件         727  2018-03-21 17:14  learning-tensorflow-master\lesson2\load_data\reader_sample.py
     文件         750  2018-03-21 17:14  learning-tensorflow-master\lesson2\load_data\reader_samples.py
     文件        1066  2018-03-21 17:14  learning-tensorflow-master\lesson2\queue.py
     文件        2964  2018-03-21 17:14  learning-tensorflow-master\lesson2\train_batch.py
     文件        2258  2018-03-21 17:14  learning-tensorflow-master\lesson2\train_queue.py
     目录           0  2018-03-21 17:14  learning-tensorflow-master\lesson3\
     文件          15  2018-03-21 17:14  learning-tensorflow-master\lesson3\.gitignore
     文件       10360  2018-03-21 17:14  learning-tensorflow-master\lesson3\cnn_olivettifaces.py
     文件      378233  2018-03-21 17:14  learning-tensorflow-master\lesson3\console_result.png
     文件      694130  2018-03-21 17:14  learning-tensorflow-master\lesson3\fig_result.png
     文件      118200  2018-03-21 17:14  learning-tensorflow-master\lesson3\model_design.png
     文件     1182905  2018-03-21 17:14  learning-tensorflow-master\lesson3\olivettifaces.gif
     目录           0  2018-08-27 17:16  learning-tensorflow-master\lesson4\
     文件          39  2018-03-21 17:14  learning-tensorflow-master\lesson4\.gitignore
     文件        1416  2018-03-21 17:14  learning-tensorflow-master\lesson4\BatchGenerator.py
............此处省略49个文件信息

评论

共有 条评论