1
+ {
2
+ "nbformat" : 4 ,
3
+ "nbformat_minor" : 0 ,
4
+ "metadata" : {
5
+ "colab" : {
6
+ "name" : " day4.ipynb" ,
7
+ "provenance" : []
8
+ },
9
+ "kernelspec" : {
10
+ "name" : " python3" ,
11
+ "display_name" : " Python 3"
12
+ }
13
+ },
14
+ "cells" : [
15
+ {
16
+ "cell_type" : " code" ,
17
+ "metadata" : {
18
+ "id" : " HiM8CZJPk6jc" ,
19
+ "colab_type" : " code" ,
20
+ "colab" : {}
21
+ },
22
+ "source" : [
23
+ " import torch.nn as nn\n " ,
24
+ " import torch.nn.functional as f"
25
+ ],
26
+ "execution_count" : 0 ,
27
+ "outputs" : []
28
+ },
29
+ {
30
+ "cell_type" : " code" ,
31
+ "metadata" : {
32
+ "id" : " sOedKVRUlJ9y" ,
33
+ "colab_type" : " code" ,
34
+ "colab" : {}
35
+ },
36
+ "source" : [
37
+ " class Net(nn.Module) :\n " ,
38
+ " def __init__(self) :\n " ,
39
+ " super(Net, self).__init__()\n " ,
40
+ " self.i = nn.Linear(64, 32)\n " ,
41
+ " self.h = nn.Linear(32, 16)\n " ,
42
+ " self.o = nn.Linear(16, 10)\n " ,
43
+ " def forward(sefl, X) :\n " ,
44
+ " X = self.i(X)\n " ,
45
+ " X = f.Sigmoid(X)\n " ,
46
+ " X = self.h(X)\n " ,
47
+ " X = f.Sigmoid(X)\n " ,
48
+ " X = self.o(X)\n " ,
49
+ " return X"
50
+ ],
51
+ "execution_count" : 0 ,
52
+ "outputs" : []
53
+ },
54
+ {
55
+ "cell_type" : " code" ,
56
+ "metadata" : {
57
+ "id" : " pyQT3dA1m9Rp" ,
58
+ "colab_type" : " code" ,
59
+ "colab" : {
60
+ "base_uri" : " https://localhost:8080/" ,
61
+ "height" : 104
62
+ },
63
+ "outputId" : " 7f7381c1-a5ee-4e08-c72e-9549892569fb"
64
+ },
65
+ "source" : [
66
+ " model = Net()\n " ,
67
+ " model"
68
+ ],
69
+ "execution_count" : 6 ,
70
+ "outputs" : [
71
+ {
72
+ "output_type" : " execute_result" ,
73
+ "data" : {
74
+ "text/plain" : [
75
+ " Net(\n " ,
76
+ " (i): Linear(in_features=64, out_features=32, bias=True)\n " ,
77
+ " (h): Linear(in_features=32, out_features=16, bias=True)\n " ,
78
+ " (o): Linear(in_features=16, out_features=10, bias=True)\n " ,
79
+ " )"
80
+ ]
81
+ },
82
+ "metadata" : {
83
+ "tags" : []
84
+ },
85
+ "execution_count" : 6
86
+ }
87
+ ]
88
+ },
89
+ {
90
+ "cell_type" : " code" ,
91
+ "metadata" : {
92
+ "id" : " XkvBVPvMnG_I" ,
93
+ "colab_type" : " code" ,
94
+ "colab" : {}
95
+ },
96
+ "source" : [
97
+ " "
98
+ ],
99
+ "execution_count" : 0 ,
100
+ "outputs" : []
101
+ }
102
+ ]
103
+ }
0 commit comments