Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I think the loss in the code id wrong, how can you explain about it? #12

Open
moving-on opened this issue Dec 27, 2018 · 2 comments
Open

Comments

@moving-on
Copy link

self.cross_entropy_loss = tf.nn.softmax_cross_entropy_with_logits(logits=self.logprobs[:, -1, :], labels=self.states)

Why you use softmax_cross_entropy_with_logits here, the first state is "[10.0, 128.0, 1.0, 1.0]*args.max_layers",so does the labels. The final output of RNN contributes to the action, why you use softmax on the action?

@moving-on
Copy link
Author

for example:
state=[10.0, 128.0, 1.0, 1.0,10.0, 128.0, 1.0, 1.0], the final output with softmax is [0.1,0.1,0.1,0.1,0.1,0.1,0.2,0.2], then the loss is:
-(10log0.1+128log0.1+1log0.1+1log0.1+10log0.1+128log0.1+1log0.2+1log0.2)
what does this mean?

@gcooq
Copy link

gcooq commented Dec 26, 2019

me too, I think each layer should use a softmax function, not the whole output with a single softmax function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants