-
大小:文件類型: .rar金幣: 1下載: 0 次發(fā)布日期: 2023-07-03
- 語言: 其他
- 標簽: tensorflow??python??
資源簡介
tensorflow實戰(zhàn)+實戰(zhàn)Google深度學習框架 源代碼修正版
代碼片段和文件信息
import?tensorflow?as?tf
INPUT_NODE?=?784
OUTPUT_NODE?=?10
IMAGE_SIZE?=?28
NUM_CHANNELS?=?1
NUM_LABELS?=?10
CONV1_DEEP?=?32
CONV1_SIZE?=?5
CONV2_DEEP?=?64
CONV2_SIZE?=?5
FC_SIZE?=?512
def?inference(input_tensor?train?regularizer):
????with?tf.variable_scope(‘layer1-conv1‘):
????????conv1_weights?=?tf.get_variable(
????????????“weight“?[CONV1_SIZE?CONV1_SIZE?NUM_CHANNELS?CONV1_DEEP]
????????????initializer=tf.truncated_normal_initializer(stddev=0.1))
????????conv1_biases?=?tf.get_variable(“bias“?[CONV1_DEEP]?initializer=tf.constant_initializer(0.0))
????????conv1?=?tf.nn.conv2d(input_tensor?conv1_weights?strides=[1?1?1?1]?padding=‘SAME‘)
????????relu1?=?tf.nn.relu(tf.nn.bias_add(conv1?conv1_biases))
????with?tf.name_scope(“l(fā)ayer2-pool1“):
????????pool1?=?tf.nn.max_pool(relu1?ksize?=?[1221]strides=[1221]padding=“SAME“)
????with?tf.variable_scope(“l(fā)ayer3-conv2“):
????????conv2_weights?=?tf.get_variable(
????????????“weight“?[CONV2_SIZE?CONV2_SIZE?CONV1_DEEP?CONV2_DEEP]
????????????initializer=tf.truncated_normal_initializer(stddev=0.1))
????????conv2_biases?=?tf.get_variable(“bias“?[CONV2_DEEP]?initializer=tf.constant_initializer(0.0))
????????conv2?=?tf.nn.conv2d(pool1?conv2_weights?strides=[1?1?1?1]?padding=‘SAME‘)
????????relu2?=?tf.nn.relu(tf.nn.bias_add(conv2?conv2_biases))
????with?tf.name_scope(“l(fā)ayer4-pool2“):
????????pool2?=?tf.nn.max_pool(relu2?ksize=[1?2?2?1]?strides=[1?2?2?1]?padding=‘SAME‘)
????????pool_shape?=?pool2.get_shape().as_list()
????????nodes?=?pool_shape[1]?*?pool_shape[2]?*?pool_shape[3]
????????reshaped?=?tf.reshape(pool2?[pool_shape[0]?nodes])
????with?tf.variable_scope(‘layer5-fc1‘):
????????fc1_weights?=?tf.get_variable(“weight“?[nodes?FC_SIZE]
??????????????????????????????????????initializer=tf.truncated_normal_initializer(stddev=0.1))
????????if?regularizer?!=?None:?tf.add_to_collection(‘losses‘?regularizer(fc1_weights))
????????fc1_biases?=?tf.get_variable(“bias“?[FC_SIZE]?initializer=tf.constant_initializer(0.1))
????????fc1?=?tf.nn.relu(tf.matmul(reshaped?fc1_weights)?+?fc1_biases)
????????if?train:?fc1?=?tf.nn.dropout(fc1?0.5)
????with?tf.variable_scope(‘layer6-fc2‘):
????????fc2_weights?=?tf.get_variable(“weight“?[FC_SIZE?NUM_LABELS]
??????????????????????????????????????initializer=tf.truncated_normal_initializer(stddev=0.1))
????????if?regularizer?!=?None:?tf.add_to_collection(‘losses‘?regularizer(fc2_weights))
????????fc2_biases?=?tf.get_variable(“bias“?[NUM_LABELS]?initializer=tf.constant_initializer(0.1))
????????logit?=?tf.matmul(fc1?fc2_weights)?+?fc2_biases
????return?logit
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????841??2017-04-20?10:35??黃文堅?唐源?TensorFlow實戰(zhàn)代碼\解壓密碼.txt
????.......?????10244??2017-03-18?22:00??黃文堅?唐源?TensorFlow實戰(zhàn)代碼\黃文堅,唐源?TensorFlow實戰(zhàn)代碼\TensorFlow實戰(zhàn)代碼\.DS_Store
????.......??????1784??2017-03-18?21:48??黃文堅?唐源?TensorFlow實戰(zhàn)代碼\黃文堅,唐源?TensorFlow實戰(zhàn)代碼\TensorFlow實戰(zhàn)代碼\3_2_HelloWorld.py
????.......??????5792??2017-03-18?21:46??黃文堅?唐源?TensorFlow實戰(zhàn)代碼\黃文堅,唐源?TensorFlow實戰(zhàn)代碼\TensorFlow實戰(zhàn)代碼\4_2_AutoEncoer.py
????.......??????1992??2017-03-18?21:49??黃文堅?唐源?TensorFlow實戰(zhàn)代碼\黃文堅,唐源?TensorFlow實戰(zhàn)代碼\TensorFlow實戰(zhàn)代碼\4_4_MLP.py
????.......??????2957??2017-03-18?21:57??黃文堅?唐源?TensorFlow實戰(zhàn)代碼\黃文堅,唐源?TensorFlow實戰(zhàn)代碼\TensorFlow實戰(zhàn)代碼\5_2_CNN_MNIST.py
????.......??????5745??2017-03-18?21:57??黃文堅?唐源?TensorFlow實戰(zhàn)代碼\黃文堅,唐源?TensorFlow實戰(zhàn)代碼\TensorFlow實戰(zhàn)代碼\5_3_CNN_CIFAR10.py
?????文件???????7779??2017-10-19?16:09??黃文堅?唐源?TensorFlow實戰(zhàn)代碼\黃文堅,唐源?TensorFlow實戰(zhàn)代碼\TensorFlow實戰(zhàn)代碼\6_1_AlexNet.py
????.......??????6608??2017-03-18?21:57??黃文堅?唐源?TensorFlow實戰(zhàn)代碼\黃文堅,唐源?TensorFlow實戰(zhàn)代碼\TensorFlow實戰(zhàn)代碼\6_2_VGG.py
????.......?????18116??2017-03-18?21:57??黃文堅?唐源?TensorFlow實戰(zhàn)代碼\黃文堅,唐源?TensorFlow實戰(zhàn)代碼\TensorFlow實戰(zhàn)代碼\6_3_InceptionNet.py
????.......?????17493??2017-03-18?21:58??黃文堅?唐源?TensorFlow實戰(zhàn)代碼\黃文堅,唐源?TensorFlow實戰(zhàn)代碼\TensorFlow實戰(zhàn)代碼\6_4_ResNet.py
????.......??????8950??2017-03-18?21:51??黃文堅?唐源?TensorFlow實戰(zhàn)代碼\黃文堅,唐源?TensorFlow實戰(zhàn)代碼\TensorFlow實戰(zhàn)代碼\7_1_Word2Vec.py
????.......??????9474??2017-03-18?21:50??黃文堅?唐源?TensorFlow實戰(zhàn)代碼\黃文堅,唐源?TensorFlow實戰(zhàn)代碼\TensorFlow實戰(zhàn)代碼\7_2_LSTM.py
????.......??????4521??2017-03-18?21:47??黃文堅?唐源?TensorFlow實戰(zhàn)代碼\黃文堅,唐源?TensorFlow實戰(zhàn)代碼\TensorFlow實戰(zhàn)代碼\7_3_BiRNN.py
????.......??????6861??2017-03-18?21:58??黃文堅?唐源?TensorFlow實戰(zhàn)代碼\黃文堅,唐源?TensorFlow實戰(zhàn)代碼\TensorFlow實戰(zhàn)代碼\8_2_PolicyNetwork.py
????.......??????4481??2017-03-18?21:44??黃文堅?唐源?TensorFlow實戰(zhàn)代碼\黃文堅,唐源?TensorFlow實戰(zhàn)代碼\TensorFlow實戰(zhàn)代碼\8_3_GridWorld.py
????.......??????8766??2017-03-18?21:44??黃文堅?唐源?TensorFlow實戰(zhàn)代碼\黃文堅,唐源?TensorFlow實戰(zhàn)代碼\TensorFlow實戰(zhàn)代碼\8_3_Value_Network.py
????.......??????6503??2017-03-18?21:59??黃文堅?唐源?TensorFlow實戰(zhàn)代碼\黃文堅,唐源?TensorFlow實戰(zhàn)代碼\TensorFlow實戰(zhàn)代碼\9_1_TensorBoard.py
????.......??????8930??2017-03-18?21:50??黃文堅?唐源?TensorFlow實戰(zhàn)代碼\黃文堅,唐源?TensorFlow實戰(zhàn)代碼\TensorFlow實戰(zhàn)代碼\9_2_MultiGPU.py
????.......?????10556??2017-03-18?21:59??黃文堅?唐源?TensorFlow實戰(zhàn)代碼\黃文堅,唐源?TensorFlow實戰(zhàn)代碼\TensorFlow實戰(zhàn)代碼\9_3_Distributed.py
?????文件????????131??2017-04-05?10:33??黃文堅?唐源?TensorFlow實戰(zhàn)代碼\黃文堅,唐源?TensorFlow實戰(zhàn)代碼\TensorFlow實戰(zhàn)代碼\Tensorflow?and?Word2vec.txt
?????文件??????51309??2017-04-20?10:34??黃文堅?唐源?TensorFlow實戰(zhàn)代碼\黃文堅,唐源?TensorFlow實戰(zhàn)代碼.zip
?????文件????9912422??2017-03-04?19:44??TensorFlow實戰(zhàn)Google深度學習框架\Data_sets\MNIST_data\train-images-idx3-ubyte.gz
?????文件??????28881??2017-03-04?19:44??TensorFlow實戰(zhàn)Google深度學習框架\Data_sets\MNIST_data\train-labels-idx1-ubyte.gz
?????文件???????5343??2017-03-04?19:44??TensorFlow實戰(zhàn)Google深度學習框架\TensorFlow實戰(zhàn)Google深度學習框架\0.12.0\Chapter03\1.?圖,張量及會話.ipynb
?????文件???????3532??2017-03-04?19:44??TensorFlow實戰(zhàn)Google深度學習框架\TensorFlow實戰(zhàn)Google深度學習框架\0.12.0\Chapter03\2.?三層簡單神經(jīng)網(wǎng)絡(luò)的前向傳播算法.ipynb
?????文件???????4340??2017-03-04?19:44??TensorFlow實戰(zhàn)Google深度學習框架\TensorFlow實戰(zhàn)Google深度學習框架\0.12.0\Chapter03\3.?完整神經(jīng)網(wǎng)絡(luò)樣例程序.ipynb
?????文件???????7329??2017-03-04?19:44??TensorFlow實戰(zhàn)Google深度學習框架\TensorFlow實戰(zhàn)Google深度學習框架\0.12.0\Chapter04\1.?自定義損失函數(shù).ipynb
?????文件???????5671??2017-03-04?19:44??TensorFlow實戰(zhàn)Google深度學習框架\TensorFlow實戰(zhàn)Google深度學習框架\0.12.0\Chapter04\2.?學習率的設(shè)置.ipynb
?????文件?????136337??2017-03-04?19:44??TensorFlow實戰(zhàn)Google深度學習框架\TensorFlow實戰(zhàn)Google深度學習框架\0.12.0\Chapter04\3.?正則化.ipynb
............此處省略242個文件信息
評論
共有 條評論