# -*- coding: utf-8 -*-
"""可以运行的,且最好的例子
"""
# Tensorboard 可视化好帮手
#执行过程 运行本文件,再cmd -> activate tensorflow -> tensorboard --logdir=E://tensorflow-example//problem//logs
# 必须是google -> http://AOC:6006
#主要方法:tf.summary.histogram(layer_name + '/outputs', outputs) 、 tf.summary.scalar('loss',loss)
#理解过程主要看下边ACT1~ACT6
#以下是代码和注释
#import packages
import tensorflow as tf
import numpy as np
#######加上这句话,解决了下边注释的问题!!!!!!!
tf.reset_default_graph()
#InvalidArgumentError: You must feed a value for placeholder tensor 'input_2/x_input' with dtype float and shape [?,1]
#添加神经网络隐藏层函数
def add_layer(inputs, in_size, out_size,n_layer, activation_function=None):
#默认是线性函数linear function
layer_name = 'layer%s' % n_layer
with tf.name_scope(layer_name):
with tf.name_scope('weight'):