This file contains hidden or 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
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 |
This file contains hidden or 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
# 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) |