Skip to content

How can I get the output of the net's last layer- symbol.LinearRegressionOutput? #2

Description

@guoswang

Hi, Chin Lin
I tried to get the net loss by add the loss into mx.sym.Group() like this:

density = self.get_Net(data)
Euclidean_loss = mx.sym.LinearRegressionOutput (data = density,label = label,grad_scale = 1/(2.*BATCH_SIZE),name = 'Euclidean_loss')
group = mx.sym.Group([mx.sym.BlockGrad(data = density), Euclidean_loss])

When training the net, I print the ''texec.outputs '' . Then I found that the loss is same as density. I don't know why ?

Also I tried to make my own loss by using the mx.sym.Makeloss

Euclidean_loss = mx.sym.MakeLoss(mx.sym.square(density - label).sum()/(2.*BATCH_SIZE))

When I training the net again, I got that the prediction is zero? I'm very appreciated it if you can help me.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions