Skip to content

Instantly share code, notes, and snippets.

git show-branch \
| sed "s/].*//" \
| grep "\*" \
| grep -v "$(git rev-parse --abbrev-ref HEAD)" \
| head -n1 \
| sed "s/^.*\[//"
@erogol
erogol / ddc_sentece_test_330k.ipynb
Last active May 14, 2021 09:40
DDC_sentece_test_330K.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@erogol
erogol / tts_example.ipynb
Last active February 12, 2024 23:46
TTS_example.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@erogol
erogol / tts_example.ipynb
Created December 19, 2018 11:50
TTS_example.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@erogol
erogol / pyworld_comparision.ipynb
Created May 2, 2018 13:09
pyworld comparision in diff settings.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@erogol
erogol / NLL_OHEM.py
Last active January 29, 2023 21:02
Online hard example mining PyTorch
import torch as th
class NLL_OHEM(th.nn.NLLLoss):
""" Online hard example mining.
Needs input from nn.LogSotmax() """
def __init__(self, ratio):
super(NLL_OHEM, self).__init__(None, True)
self.ratio = ratio
@erogol
erogol / dataset_mongo.py
Last active April 19, 2023 08:24
PyTorch MongoDB dataset interface
import io
import os
import numpy as np
from PIL import Image
from pymongo import MongoClient
from torch.utils.data import Dataset, DataLoader
from torchvision import transforms
def pil_loader(f):
@erogol
erogol / spp_net.py
Last active January 23, 2020 16:31
Pytorch implementation of SPP net
import math
from collections import OrderedDict
import torch.nn as nn
import torch.nn.init as init
import torch as th
import torch.nn.functional as F
from torch.autograd import Variable
class SPPLayer(nn.Module):