Skip to content

Instantly share code, notes, and snippets.

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)
@ChrisHayduk
ChrisHayduk / merge_qlora_with_quantized_model.py
Last active November 13, 2024 10:49
Merging QLoRA weights with quantized model
"""
The code below combines approaches published by both @eugene-yh and @jinyongyoo on Github.
Thanks for the contributions guys!
"""
import torch
import peft