Skip to content
Snippets Groups Projects
Commit e0d8dd82 authored by Falguni Ghosh's avatar Falguni Ghosh
Browse files

Upload New File

parent 248d0d2d
Branches
Tags
No related merge requests found
import numpy as np
from .Base import BaseLayer
class ReLU(BaseLayer):
def __init__(self):
super().__init__()
self.buffered_input = None
def forward(self, input_tensor):
self.buffered_input = input_tensor
input_tensor[input_tensor < 0] = 0
return input_tensor
def backward(self, error_tensor):
error_tensor[self.buffered_input <= 0] = 0
return error_tensor
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment