Skip to content

Instantly share code, notes, and snippets.

@chrico-bu-uab
chrico-bu-uab / eswish.py
Last active November 26, 2019 03:11
which version is better?
from scipy.special import expit
class Eswish1(Layer):
def __init__(self, beta):
self.ReLUness = 0
self.layertype = 'Eswish'
self.beta = beta
def forward(self, input, is_train):
self.input = input
@chrico-bu-uab
chrico-bu-uab / activation_wrk.py
Created November 8, 2019 09:57
some python neural network stuff
# Adapted from Jovian Lin's code (hyperlink unavailable)
import numpy as np
from scipy.special import expit
from enum import Enum
from typing import Union
np.seterr(divide='raise', over='raise', under='warn', invalid='raise')
logmax = np.log(np.finfo(np.float64).max)