apply l2 norm in a bert model wrapped in a pytorch lightning model
Jump to turn (24)
- 1apply l2 norm in a bert model wrapped in a pytorch lightning model
- 2how about frobenius instead of l2
- 3which value of frobenius\reg people use?
- 4why weight decay of the optimizer equals frobenius\reg
- 5i mean, is it more efficient than using a separate value for weight decay and fr
- 6does people often use l2 with frobenius in the same model?
- 7so in general, what is the benefits of using frobenius
- 8is there any regularization methods that i can try to apply in my model?
- 9is there something called N3 that is used for regularization?
- 10i'm not certain but maybe N3 means n nearest neighbors
- 11should i use frobenius or L2 in my model if I used weight decay in the optimizer
- 12i tried frobenius in my model but the loss blows up too big, is there any proble
- 13how can I apply negative samples in a bert model wrapped in a pytorch lightning
- 14in the previous code, you use a zero tensor as labels for negative samples, does
- 15i tried -1 value but I encounter an error while using it with cross entropy loss
- 16then how do I add negative loss?
- 17what is the role of margin
- 18so if I say margin is 0.1, what does it mean?
- 19why negative loss is calculated as relu of margin subtract logits
- 20how do you ensure that negative loss is less than or equal positive loss? I don'
- 21i told the opposite, negative loss is less than or equal to the positive loss
- 22def negative\loss(self, logits, negative\samples): negative\logits = logits[nega
- 23you set the margin to 0.1, but the negative logits are bigger because it is the
- 24why negative logits that is greater than margin is penalized? the positive logit
- User
apply l2 norm in a bert model wrapped in a pytorch lightning model
- Assistant
Here is an example of how you can apply L2 norm to the weights of a BERT model wrapped in a PyTorch Lightning model:
python
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.