Releases: libwaifu/Waifu-SY
Releases · libwaifu/Waifu-SY
Training #2
Tang-RNN
SetDirectory[NotebookDirectory[]];
encoder = NetEncoder[{"Characters", chars = Append[Import["chars.WXF"], _]}]
trainingData = encoder /@ Import["ipt.WXF"]; // TT
predictNet = NetChain[{
UnitVectorLayer[Length@chars],
GatedRecurrentLayer[128],
GatedRecurrentLayer[128],
NetMapOperator[LinearLayer[Length@chars]],
SoftmaxLayer[]
}];
teacherForcingNet = NetGraph[<|
"predict" -> predictNet,
"rest" -> SequenceRestLayer[],
"most" -> SequenceMostLayer[],
"loss" -> CrossEntropyLossLayer["Index"]
|>, {
NetPort["Input"] -> "most" -> "predict" -> NetPort["loss", "Input"],
NetPort["Input"] -> "rest" -> NetPort["loss", "Target"]
},
"Input" -> {Length@First[trainingData], "Integer"}
] // NetInitialize
result = NetTrain[teacherForcingNet,
<|"Input" -> trainingData|>, All,
MaxTrainingRounds -> 100, TimeGoal -> 3600,
TrainingProgressCheckpointing -> {
"Directory", "CheckPoints", "Interval" -> Quantity[10000, "Batches"]
},
BatchSize -> 64, TargetDevice -> "GPU",
ValidationSet -> Scaled[0.01]
]
Export["result.WXF", result, PerformanceGoal -> "Size"]
Training #1
REPORT = <|
"Quality" -> {
<|"FinalRoundErrorRate" -> 0.42033032319391633|>,
<|"FinalRoundLoss" -> 1.355493026017108|>,
<|"FinalValidationErrorRate" -> 0.43569057901471525|>,
<|"FinalValidationLoss" -> 1.4399253633338063|>,
<|"LowestValidationErrorRate" -> 0.43569057901471525|>,
<|"LowestValidationLoss" -> 1.4399253633338063|>,
<|"LowestValidationRound" -> 26|>
},
"Quantity" -> {
<|"TotalTrainingTime" -> 3600.0066981966856|>,
<|"TotalBatches" -> 351813|>,
<|"TotalInputs" -> 22516032|>,
<|"TotalRounds" -> 26|>,
<|"MeanBatchesPerSecond" -> 97.72565150399026|>,
<|"MeanInputsPerSecond" -> 6254.441696255377|>
},
"Method" -> {
<|"OptimizationMethod" -> "ADAM"|>,
<|"InitialLearningRate" -> 0.001|>,
<|"FinalLearningRate" -> 0.001|>,
<|"BatchSize" -> 64|>,
<|"VersionNumber" -> "11.3.5"|>
}
|>;
First Blood!
v1.0.0 模型::Tableaux remake