Giter Club home page Giter Club logo

tensorflow-coding's Introduction

tensorflow-coding's People

Contributors

zhaoyingjun avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tensorflow-coding's Issues

LessionOne代码中几个我认为有问题的地方...

在cnnModel.py中:
问题1:
line 143:
keep_prop=tf.Variable(initial_value=0.5,name="keep_prop")
line 144:
self.fc_result=create_CNN(input_data=self.data_tensor,num_classes=gConfig['num_dataset_classes'],keep_prop=gConfig['keeps']
keep_prop变量并没有被用到,且在144行,参数keep_prop=gConfig['keeps']不能这样写,因为后面要根据forward_only的值,传不同的参数给keep_prop变量。
我认为应该讲keep_prop定义为place_holder,以下为参考:
self.keep_prop=tf.placeholder(tf.float32,name="keep_prop") self.fc_result=create_CNN(input_data=self.data_tensor,num_classes=gConfig['num_dataset_classes'],keep_prop=self.keep_prop)、

问题2:
line 200:
accuracy = correct.size/(self.percent*gConfig['dataset_size']/100)
这里求accuracy的分母,要改为shuffled_data.shape[0]

问题3:
cnnModel:
step函数中,if forward_only:这一部分应该也需要更改或者重写,请核实

Performance issues in lessonEight/textClassiferModel.py(P2)

Hello,I found a performance issue in the definition of train_input_fn ,
lessonEight/textClassiferModel.py,
dataset = dataset.map(parser) was called without num_parallel_calls.
I think it will increase the efficiency of your program if you add this.

The same issues also exist in dataset = dataset.map(parser)

Here is the documemtation of tensorflow to support this thing.

Looking forward to your reply. Btw, I am very glad to create a PR to fix it if you are too busy.

Performance issue in the definition of train, lessonOne/imgClassifierWeb/execute.py(P1)

Hello, I found a performance issue in the definition of train, lessonOne/imgClassifierWeb/execute.py, tf.argmax(softmax_propabilities, axis=1) will be created repeatedly during program execution, resulting in reduced efficiency. I think it should be created before the loop.

The same issue exists in:

Looking forward to your reply. Btw, I am very glad to create a PR to fix it if you are too busy.

label的one-hot编码

cross_entropy=tf.nn.sparse_softmax_cross_entropy_with_logits(logits=self.softmax_propabilities,

老师您好,我是听了小象学院课程的学生,关于这行代码有两个问题想请教:

  1. 根据tf.nn.sparse_softmax_cross_entropy_with_logits的文档,label可以直接放入数值化的标签结果,请问您这里为什么做了One-hot处理呢?
  2. 根据tf.nn.sparse_softmax_cross_entropy_with_logits的文档,这里的logits应该是未经softmax处理的结果(这个函数会进行softmax操作),您这里输入的为什么是经过softmax后的值呢?

初学请教,理解错误之处请您谅解;万望回复,谢谢啦!

cnnModel.py

def dropout_flatten_layer(previous_layer, keep_prop):
dropout = tf.nn.dropout(x=previous_layer, keep_prob=keep_prop)
num_features = dropout.get_shape()[1:].num_elements()
layer = tf.reshape(previous_layer, shape=(-1, num_features)) # Flattening the results.
return layer

里面是不是写错了,应该是tf.reshape(dropout , shape=(-1, num_features))

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.