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

What is the Loss function? #1

Open
luyuhao98 opened this issue Aug 12, 2019 · 0 comments
Open

What is the Loss function? #1

luyuhao98 opened this issue Aug 12, 2019 · 0 comments

Comments

@luyuhao98
Copy link

First, doesn't the code in Line 97 and Line 98 have some problems about the index?
here is the code from Line 93 to Line 101

    #Modify output to backprop gradient based on network output
    sh = out.squeeze().shape
    conf_softmax = np.zeros((1,sh[0],sh[1],sh[2]))        
    if args.type == 'one-hot':
        for i in np.arange(sh[0]):       # should be sh[1] ? 
            for j in np.arange(sh[1]):   # should be sh[2] ?                                                    
                conf_softmax[0,out_argmax[i,j],i,j]=1.0  
    elif args.type== 'same':
        conf_softmax = copy.deepcopy(out[None,:,:,:])

Second, what is the loss function? Why could conf_softmax be output_layer_grad directly?

I'm a Novice to Caffe and I try to understand your code. Could you help me with these questions?

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

1 participant