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 multiprocessing | |
import time | |
import numpy as np | |
import keras.backend as K | |
import keras.layers as KL | |
from keras import Model | |
from keras.callbacks import Callback | |
from keras.utils import Sequence |
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 numpy as np | |
from keras.layers import Input, Lambda | |
from keras.models import Model | |
from keras.utils import Sequence | |
class SSEquence(Sequence): | |
def __init__(self, value=1): | |
self.value = value |
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 multiprocessing | |
import threading | |
import time | |
from Queue import Queue | |
class Sequence(): | |
def __init__(self, my_list): | |
self.my_list = my_list |
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
class weighted_categorical_crossentropy: | |
def __init__(self, weights): | |
self.weights = weights | |
self.__name__ = 'wcentroid_loss' | |
def __call__(self, y_true, y_pred): | |
class0 = K.ones_like(y_pred)[:, :, :, 0] * self.weights[0] | |
class1 = K.ones_like(y_pred)[:, :, :, 0] * self.weights[1] | |
x = K.tf.where(y_true[:, :, :, 0] > 0, class0, class1) | |
result = x * K.categorical_crossentropy(y_pred, y_true) |
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 numpy as np | |
import torch | |
import torch.nn as nn | |
import torch.nn.init as init | |
from torch.autograd import Variable | |
class Layer(nn.Module): | |
def __init__(self, in_, out, kernel, init_kernel='uniform', padding=1): | |
super(Layer, self).__init__() |
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 | |
import time | |
from concurrent.futures import ProcessPoolExecutor | |
from itertools import cycle | |
from queue import Queue | |
from threading import Thread, Event | |
from keras.engine.training import GeneratorEnqueuer | |
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 operator | |
import threading | |
from functools import reduce | |
import keras | |
import keras.backend as K | |
from keras.engine import Model | |
import numpy as np | |
import tensorflow as tf | |
import time |
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 tensorflow as tf | |
import numpy as np | |
import keras | |
import keras.backend as K | |
from keras.models import Model | |
import keras.callbacks as cbks | |
import threading | |
from keras.layers import Layer, Input, InputLayer, Dense | |
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 keras.backend as K | |
import tensorflow as tf | |
class Model: | |
def __init__(self,batch_size): | |
self.batch_size = batch_size | |
def loss_DSSIS_tf11(self, y_true, y_pred): | |
"""Need tf0.11rc to work""" | |
y_true = tf.reshape(y_true, [self.batch_size] + get_shape(y_pred)[1:]) | |
y_pred = tf.reshape(y_pred, [self.batch_size] + get_shape(y_pred)[1:]) |
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
""" | |
Simple alarm clock to be awaken to the sound of your choice | |
""" | |
import datetime as dt | |
import time | |
import webbrowser | |
import argparse | |
import sys | |
from dateutil.relativedelta import relativedelta |
NewerOlder