MCPcopy Index your code
hub / github.com/OpenGVLab/InternVL / build_criterion

Function build_criterion

classification/main_deepspeed.py:95–104  ·  view source on GitHub ↗
(config)

Source from the content-addressed store, hash-verified

93
94
95def build_criterion(config):
96 if config.AUG.MIXUP > 0.:
97 # smoothing is handled with mixup label transform
98 criterion = SoftTargetCrossEntropy()
99 elif config.MODEL.LABEL_SMOOTHING > 0.:
100 criterion = LabelSmoothingCrossEntropy(
101 smoothing=config.MODEL.LABEL_SMOOTHING)
102 else:
103 criterion = torch.nn.CrossEntropyLoss()
104 return criterion
105
106
107def scale_learning_rate(config, num_processes):

Callers 1

trainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected