Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import torch | |
import torch.nn as nn | |
import torch.nn.functional as F | |
# Focal loss implementation inspired by | |
# https://github.com/c0nn3r/RetinaNet/blob/master/focal_loss.py | |
# https://github.com/doiken23/pytorch_toolbox/blob/master/focalloss2d.py | |
class MultiClassBCELoss(nn.Module): | |
def __init__(self, | |
use_weight_mask=False, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from keras import backend as K | |
from keras import callbacks | |
from keras import layers | |
from keras import models | |
from keras.wrappers.scikit_learn import KerasClassifier | |
import pandas as pd | |
import tensorflow as tf | |
from sklearn import metrics |