# How to build custom loss function including restrictions about the derivatives of a model with respect to input features

**URL:** <https://discourse.julialang.org/t/how-to-build-custom-loss-function-including-restrictions-about-the-derivatives-of-a-model-with-respect-to-input-features/100880>\
**Category:** New to Julia\
**Tags:** simplechains\
**Created:** [June 27, 2023, 8:12am UTC](https://discourse.julialang.org/t/how-to-build-custom-loss-function-including-restrictions-about-the-derivatives-of-a-model-with-respect-to-input-features/100880 "2023-06-27T08:12:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![yourun1218](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yourun1218/32/51076_2.png) [@yourun1218](https://discourse.julialang.org/u/yourun1218)\
**Post date:** [June 27, 2023, 8:12am UTC](https://discourse.julialang.org/t/how-to-build-custom-loss-function-including-restrictions-about-the-derivatives-of-a-model-with-respect-to-input-features/100880/1 "2023-06-27T08:12:28Z")

</div>

Hi SimpleChains.jl people!

I am trying to build a custom loss function including restrictions about the derivatives of a model with respect to input features in addition to the values of the model. In other words, I would like to target both the values and the derivatives of a model with respect to input features.

If you have an idea about the way to target the derivative of a model using SimpleChains, please let me know. Thanks for your help.
