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

Upload New File

parent 9d615f81
No related branches found
No related tags found
No related merge requests found
import numpy as np
from .Base import BaseLayer
class Sigmoid(BaseLayer):
def __init__(self):
super().__init__()
self.activation = None
self.error_tensor = None
def forward(self,input_tensor):
self.activation = 1/(1 + np.exp(-1*input_tensor))
return self.activation
def backward(self,error_tensor):
self.error_tensor = error_tensor * (self.activation*(1-self.activation))
return self.error_tensor
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment