Skip to content

Instantly share code, notes, and snippets.

View Ab1992ao's full-sized avatar

Alexander Abramov Ab1992ao

View GitHub Profile
@Ab1992ao
Ab1992ao / fit.py
Created February 26, 2019 08:18 — forked from MaxHalford/fit.py
Keras fit/predict scikit-learn pipeline
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
@Ab1992ao
Ab1992ao / Loss.py
Created September 6, 2019 06:25 — forked from snakers4/Loss.py
Multi class classification focal loss
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,
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.