zoukankan      html  css  js  c++  java
  • tensorflow学习笔记10

    神经网络模型架构1

    import numpy as np
    import tensorflow as tf
    import matplotlib.pyplot as plt
    import input_data
    
    mnist = input_data.read_data_sets('data/',one_hot=True) #one_hot=True编码格式为01编码
    n_hidden_1 = 256
    n_hidden_2 = 128
    n_input = 784
    n_classes = 10
    
    x = tf.placeholder("float",[None,n_input])
    y = tf.placeholder("float",[None,n_classes])
    
    stddev = 0.1
    weights = {
        'w1':tf.Variable(tf.random.normal([n_input,n_hidden_1],stddev=stddev)),
        'w2':tf.Variable(tf.random.normal([n_hidden_1,n_hidden_2],stddev=stddev)),
        'out':tf.Variable(tf.random.normal([n_hidden_2,n_classes],stddev=stddev))
    }
    biases = {
        'bi':tf.Variable(tf.random.normal([n_hidden_1])),
        'b2':tf.Variable(tf.random.normal([n_hidden_2])),
        'out':tf.Variable(tf.random.normal([n_classes]))
    }
    print("NETWORK READY")

  • 相关阅读:
    nodejs
    socket.io
    how to develop mobile web
    nodejs
    GitHub
    angularJS vs backbone
    AngularJS
    oracle 数据库中数据导出到excel
    cocos2d-x中的二段构造模式
    HDOJ 4975 A simple Gaussian elimination problem.
  • 原文地址:https://www.cnblogs.com/xrj-/p/14457333.html
Copyright © 2011-2022 走看看