Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Task_3
  • Loading branch information
souravmenon1999 authored Jun 17, 2020
commit 81732b1f21d203c75f3d62109e767bae3601f0c0
30 changes: 30 additions & 0 deletions Tasks/daily tasks/Sourav_Menon/task3.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import torch
import torch as nn

#creating a class as Net
class Net(nn.module):

def __init__(self,input_layer,hidden_layer1,hidden_layer2,output_layer):

super(Net,self).__init__()
self.t1=nn.Linear(input_size,hiden_layer1)

self.f1=nn.sigmoid()

self.t2=nn.Linear(hidden_layer1,hiddenl_layer2)

self.f2=nn.sigmoid()

self.t3=nn.linear(hidden_layer2,output_layer)


def forward(self,x):
x=self.t1(x)
x=self.f1(x)
x=self.t2(x)
x=self.f2(x)
x=self.t3(x)

return x