Since my dataset is very unbalanced (counts: [6990, 3668, 932]), I tried using the WeightedRandomSampler like this:
        label_counts = get_label_counts()
        weights = calculateWeights(label_counts, trainset)
        weights = torch.DoubleTensor(weights)
        sampler = torch.utils.data.sampler.WeightedRandomSampler(weights, flags.batch_size, replacement=True)

        trainloader = DataLoader(trainset, batch_size=batch_size, sampler=sampler,
                                 shuffle=False,
                                 num_workers=dataloader_workers, pin_memory=False)

While this resulted in a decreasing eval loss, it also resulted in a decrease of the average precision metric:
[1,     4] eval loss: 0.649                                                                                                            
average precision score for label Lung Opacity: 0.023283850652271707                           
average precision score for label Pleural Effusion: 0.8453838299452334                                                                 
average precision score for label Support Devices: 0.30195558827137775                                                                 
total average precision score:  0.3840782327170712                                                                                     
[2,     4] eval loss: 0.559                                                                                                            
average precision score for label Lung Opacity: 0.00631578947368421                             
average precision score for label Pleural Effusion: 0.5314078144938429                                                                 
average precision score for label Support Devices: 0.16108225108225105                                                                 
total average precision score:  0.22906761877806514                                                                                    
[3,     4] eval loss: 0.554                                                                                                                                                                                                                                                   
average precision score for label Lung Opacity: 0.019230769230769232                                                                   
average precision score for label Pleural Effusion: 0.38544439176018125                                                                
average precision score for label Support Devices: 0.24436025408348455                                                                 
total average precision score:  0.20874856524908808                                                                                    
[4,     4] eval loss: 0.597                                                                                                            
average precision score for label Lung Opacity: 0.02124156545209177                                                                    
average precision score for label Pleural Effusion: 0.47914230019493176                                                                
average precision score for label Support Devices: 0.3903263535182041                                                                  
total average precision score:  0.289516208895232                                                                                      
[5,     4] eval loss: 0.639                                                                                                            
average precision score for label Lung Opacity: 0.06151532677848468                                                                    
average precision score for label Pleural Effusion: 0.5080161445568739                         
average precision score for label Support Devices: 0.5386326711720936                                                                  
total average precision score:  0.3640341420969798                                                                                     
[6,     4] eval loss: 0.639                                                                                                            
average precision score for label Lung Opacity: 0.058812897628687105     
average precision score for label Pleural Effusion: 0.37564192863989315                         
average precision score for label Support Devices: 0.6009432116877559                                                                  
total average precision score:  0.342691608052389                                                                                                                                                                                                                             
[7,     4] eval loss: 0.619                                                                                                                                                                                                                                                   
average precision score for label Lung Opacity: 0.0368578497525866                                                                     
average precision score for label Pleural Effusion: 0.20133116295894374                   
average precision score for label Support Devices: 0.6092644842346415                                                                  
total average precision score:  0.28078888011996644                                                                                    
[8,     4] eval loss: 0.593                                                                                                            
average precision score for label Lung Opacity: 0.034815432245772805                                                                   
average precision score for label Pleural Effusion: 0.1060627603868058              
average precision score for label Support Devices: 0.5772248803827751
total average precision score:  0.23698103747819874
[9,     4] eval loss: 0.580
average precision score for label Lung Opacity: 0.034815432245772805
average precision score for label Pleural Effusion: 0.0837037037037037
average precision score for label Support Devices: 0.5552300562727573
total average precision score:  0.22253502844545667
[10,     4] eval loss: 0.573
average precision score for label Lung Opacity: 0.04508465218991535 
average precision score for label Pleural Effusion: 0.0816934073074424
average precision score for label Support Devices: 0.52619486964423 
total average precision score:  0.21558748943364328
[11,     4] eval loss: 0.567
average precision score for label Lung Opacity: 0.049222334682860996
average precision score for label Pleural Effusion: 0.08571863262492273
average precision score for label Support Devices: 0.4878277238159777
total average precision score:  0.2060174442300899
[12,     4] eval loss: 0.555
average precision score for label Lung Opacity: 0.049222334682860996
average precision score for label Pleural Effusion: 0.08976109524457139
average precision score for label Support Devices: 0.41929824561403506
total average precision score:  0.18447285023275561

Is my metric wrong?