# Setting L2 part way through training

**URL:** <https://community.konduit.ai/t/setting-l2-part-way-through-training/91>\
**Category:** DL4J\
**Created:** [January 22, 2020, 8:33pm UTC](https://community.konduit.ai/t/setting-l2-part-way-through-training/91 "2020-01-22T20:33:41Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Foodyborris](https://avatars.discourse-cdn.com/v4/letter/f/9fc29f/32.png) [@Foodyborris](https://community.konduit.ai/u/Foodyborris)\
**Post date:** [January 22, 2020, 8:33pm UTC](https://community.konduit.ai/t/setting-l2-part-way-through-training/91/1 "2020-01-22T20:33:41Z")

</div>

Is there an easy way to set L2 part way through training, rather than just when the model is created? I can see how to vary the learning rate on an existing model but don’t see a corresponding L2 method. Should I be creating NeuralNetConfiguration and attaching it to each layer of my existing model?

---

<div class="post-metadata">

**Author:** ![Foodyborris](https://avatars.discourse-cdn.com/v4/letter/f/9fc29f/32.png) [@Foodyborris](https://community.konduit.ai/u/Foodyborris)\
**Post date:** [January 24, 2020, 4:09pm UTC](https://community.konduit.ai/t/setting-l2-part-way-through-training/91/2 "2020-01-24T16:09:02Z")

</div>

Nope - that doesn’t work.

It looks like I need to make custom Schedule.

---

<div class="post-metadata">

**Author:** ![DonaldAlan](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/donaldalan/32/369_2.png) [@DonaldAlan](https://community.konduit.ai/u/DonaldAlan)\
**Post date:** [November 26, 2020, 9:09pm UTC](https://community.konduit.ai/t/setting-l2-part-way-through-training/91/3 "2020-11-26T21:09:07Z")

</div>

Is this still the case? And can we change DropOut or WeightDecay programmatically?

---

<div class="post-metadata">

**Author:** ![agibsonccc](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/agibsonccc/32/697_2.png) [@agibsonccc](https://community.konduit.ai/u/agibsonccc)\
**Post date:** [November 26, 2020, 10:26pm UTC](https://community.konduit.ai/t/setting-l2-part-way-through-training/91/4 "2020-11-26T22:26:13Z")

</div>

@DonaldAlan l1/l2 is generally changed like this: [deeplearning4j/GradientCheckTests.java at f9aebec79e18671c1c5680b31262467f8e83d30f · eclipse/deeplearning4j · GitHub](https://github.com/eclipse/deeplearning4j/blob/f9aebec79e18671c1c5680b31262467f8e83d30f/deeplearning4j/deeplearning4j-core/src/test/java/org/deeplearning4j/gradientcheck/GradientCheckTests.java#L260)

---

<div class="post-metadata">

**Author:** ![DonaldAlan](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/donaldalan/32/369_2.png) [@DonaldAlan](https://community.konduit.ai/u/DonaldAlan)\
**Post date:** [November 26, 2020, 11:18pm UTC](https://community.konduit.ai/t/setting-l2-part-way-through-training/91/5 "2020-11-26T23:18:30Z")

</div>

I mean: can we change it DYNAMICALLY while a MultiLayerNetwork is learning (not just in config)? We can change learningRate.

---

<div class="post-metadata">

**Author:** ![agibsonccc](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/agibsonccc/32/697_2.png) [@agibsonccc](https://community.konduit.ai/u/agibsonccc)\
**Post date:** [November 26, 2020, 11:28pm UTC](https://community.konduit.ai/t/setting-l2-part-way-through-training/91/6 "2020-11-26T23:28:04Z")

</div>

@DonaldAlan in that case not that I can see. Typically you only do learning rates on a schedule, I’m not sure I’ve seen l2 penalty on a schedule.
