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

Function build_criterion

classification/main_accelerate.py:98–107  ·  view source on GitHub ↗
(config)

Source from the content-addressed store, hash-verified

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

Callers 1

trainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected