# Define a sequential model using Sequential literal
model = nn.Sequential(
nn.Conv2d(1,20,5),
nn.ReLU(),
nn.Conv2d(20,64,5),
nn.ReLU()
)
# Define a sequential model using OrderedDict
model = nn.Sequential(OrderedDict([
('conv1', nn.Conv2d(1,20,5)),
('relu1', nn.ReLU()),
('conv2', nn.Conv2d(20,64,5)),
('relu2', nn.ReLU())
]))
# source : https://pytorch.org/docs/stable/generated/torch.nn.Sequential.html
# init a new set, assign it to a variable
# add a number to it and display that variable
my_set = set()
my_set.add(1)
my_set # --> returns {1}
num_list = [1, 2, -99, 8, 2]
# Uniqtech Co. min tutorial
def state_machine(num_list):
min_val = float('inf')
for num in num_list:
if num < min_val:
min_val = num
return min_val
state_machine(num_list)
# >>> -99
# Uniqtech Co. min tutorial