Skip to main content
1 of 8
partida
  • 6.9k
  • 24
  • 48

Similar data,different level of MES loss?

Using same net and similar data,but MSE is very different.

originalData = Get["https://wolfr.am/lRWRvwBp"];
originalGenerator = <|"EmbeddingLayerInput" -> Rationalize@#[[All, 1]], "Input2" -> #[[All, 2 ;; 13]], "Output" -> #[[All, 14 ;;]]|> &@RandomSample[originalData, #BatchSize] &;
originalGenerator[<|"BatchSize" -> 3|>]

enter image description here

net = NetGraph[{EmbeddingLayer[128, "Input" -> NetEncoder[{"Class", Range[0, Max@data[[All, 1]]]}]], CatenateLayer[], 512, Ramp, 43},{NetPort["EmbeddingLayerInput"] -> 1 -> 2, NetPort["Input2"] -> 2, 2 -> 3 -> 4 -> 5}, "Input2" -> 12]

enter image description here

NetTrain[net, originalGenerator, MeanSquaredLossLayer[],"LossEvolutionPlot", BatchSize -> 300, MaxTrainingRounds -> 200]

enter image description here

INPUTNOTE = Length[originalData];
testData = Transpose[{Join[List /@ originalData[[All, 1]], RandomReal[1, {INPUTNOTE, 12}], 2], RandomReal[1, {INPUTNOTE, 43}]}];
testGenerator = <|"EmbeddingLayerInput" -> Rationalize@#[[All, 1, 1]],"Input2" -> #[[All, 1, 2 ;;]], "Output" -> #[[All, 2]]|> &@RandomSample[testData, #BatchSize] &;

testGenerator[<|"BatchSize" -> 3|>]

enter image description here

NetTrain[net, testGenerator, MeanSquaredLossLayer[], "LossEvolutionPlot", BatchSize -> 300, MaxTrainingRounds -> 200]

enter image description here

So why using similar data but different level of MES loss?

partida
  • 6.9k
  • 24
  • 48