# How to fine tune BERT with customized classifier and loss function?

**URL:** <https://discuss.huggingface.co/t/how-to-fine-tune-bert-with-customized-classifier-and-loss-function/4334>\
**Category:** Intermediate\
**Created:** [March 12, 2021, 3:30am UTC](https://discuss.huggingface.co/t/how-to-fine-tune-bert-with-customized-classifier-and-loss-function/4334 "2021-03-12T03:30:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pei](https://avatars.discourse-cdn.com/v4/letter/p/a698b9/32.png) [@Pei](https://discuss.huggingface.co/u/Pei)\
**Post date:** [March 12, 2021, 3:30am UTC](https://discuss.huggingface.co/t/how-to-fine-tune-bert-with-customized-classifier-and-loss-function/4334/1 "2021-03-12T03:30:16Z")

</div>

I would like to fine tune BERT on my own data and task, is there an easy way to add my own classifier and loss function based on the trainer module?
