This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
The code below combines approaches published by both @eugene-yh and @jinyongyoo on Github. | |
Thanks for the contributions guys! | |
""" | |
import torch | |
import peft |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MultiLayerConfiguration.Builder builder = new NeuralNetConfiguration.Builder() | |
.seed(123) | |
.iterations(iterations) | |
.regularization(true).l2(.0005) //Arbitrary | |
.learningRate(0.005) | |
.weightInit(WeightInit.XAVIER) | |
.gradientNormalization(GradientNormalization.ClipElementWiseAbsoluteValue) | |
.optimizationAlgo(OptimizationAlgorithm.STOCHASTIC_GRADIENT_DESCENT) | |
.updater(Updater.NESTEROVS).momentum(0.5) | |
.list(6) |