Group Abstract Group Abstract

Message Boards Message Boards

Plot the round loss,batch loss and use other properties of nettrain?

Posted 7 years ago

I am using the NetTrain and i want to plot the graphs that i see during the training that takes place and also the batch loss and round loss.

I saw the documentation and found something about NetTrain[net, data, prop] where prop has various options but when i try to use them the training just doesnt happen but does not give any error.

Please help.

POSTED BY: Pushkar D
4 Replies

Pushkar D, something below will work:

{batchloss, roundloss, trained} = 
 NetTrain[LinearLayer[], {1 -> 1.9, 2 -> 4.1, 3 -> 6.0, 4 -> 8.1}, 
 {"BatchLossList", "RoundLossList", "TrainedNet"}]

This also work:

trained2 =
  NetTrain[LinearLayer[], {1 -> 1.9, 2 -> 4.1, 3 -> 6.0, 4 -> 8.1},
   All];
batchloss = trained2["BatchLossList"]
roundloss = trained2["RoundLossList"]
POSTED BY: Kotaro Okazaki
Posted 7 years ago

@Kotaro Okazaki I have been trying to do something similar and ran into a different problem:

trainedNet = 
  NetTrain[vggNet2, trainingData, ValidationSet -> testingData, All, 
   MaxTrainingRounds -> maxTrainingRounds, BatchSize -> batchSize, 
   Method -> {optimizer}];

batchloss = trainedNet["BatchLossList"]
roundloss = trainedNet["RoundLossList"]

The problem i am facing is :

NetTrain[NetChain[Input port:   image
Output port:    class
Number of layers:   47    ],
{ here it gives list of all the input images i have given}, All, MaxTrainingRounds -> 1, BatchSize -> 4, 
      Method -> {"ADAM"}]["BatchLossList"]

It does the same with RoundLossList as well, can you please suggest what i am doing wrong? The net is not getting trained.

POSTED BY: Ashish Sharma
POSTED BY: Kotaro Okazaki
Posted 7 years ago
POSTED BY: Ashish Sharma
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard