lonePatient / Bert-Multi-Label-Text-Classification

This repo contains a PyTorch implementation of a pretrained BERT model for multi-label text classification.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Difference between f1 and valid_f1

AbdulRafay opened this issue · comments

commented

Hi,

I am calculating f1 score by passing metric in trainer

trainer = Trainer(n_gpu=args.n_gpu,
                      model=model,
                      epochs=args.epochs,
                      logger=logger,
                      criterion=BCEWithLogLoss(),
                      optimizer=optimizer,
                      lr_scheduler=lr_scheduler,
                      early_stopping=None,
                      training_monitor=train_monitor,
                      fp16=args.fp16,
                      resume_path=args.resume_path,
                      grad_clip=args.grad_clip,
                      model_checkpoint=model_checkpoint,
                      gradient_accumulation_steps=args.gradient_accumulation_steps,
                      batch_metrics=[AccuracyThresh(thresh=0.5)],
                      epoch_metrics=[AUC(average='micro', task_type='binary'),
                                     MultiLabelReport(id2label=id2label), F1Score(task_type='binary', average='macro')])

in logs i can see two f1 scores like following:

image

there is f1 and valid_f1 score. what is the difference?

@lonePatient can you please help me understand

@AbdulRafay F1 is for training datasets and valid_f1 is for dev dataset

commented

great thanks