(ZeroPadding2D)
(None, None, None, 3 0 | input_1[0][0] | | | | conv1_conv (Conv2D) | (None, None, None, 6 9472 | conv1_pad[0][0] | | |
| conv1_bn None, None, 6 0 | pool1_pad[0][0] | | |
| conv2_block1_1_conv (Conv2D) | (None, None, None, 6 4160 | pool1_pool[0][0] | | |
| conv2_block1_1_bn None, 6 0 | conv2_block1_1_bn[0][0] | | |
| conv2_block1_2_conv (Conv2D) | (None, None, None, 6 36928 | conv2_block1_1_relu[0][0] | | |
0 码力 |
54 页 |
6.30 MB
| 2 年前 3
bias_regularizer=None,
activity_regularizer=None,
kernel_constraint=None,
bias_constraint=None)
## Conv2D
It is a convolution 2D layer. It creates a convolutional kernel with the layer input creates a tensor the tuple of integers with RGB value in data_format="channels_last".
The signature of the Conv2D function and its arguments with default value is as follows:
keras.layers.Conv2D
(filters,
kernel_size (1, 8, 28) $ values.
- First layer, Conv2D consists of 32 filters and 'relu' activation function with kernel size, $ (3,3) $ .
- Second layer, Conv2D consists of 64 filters and 'relu'
0 码力 |
98 页 |
1.57 MB
| 2 年前 3
Framework
• New operators like TF quantized_conv2d
• Underlying calculations are different than FP32 conv2d
real_value = scale * (quantized_value - zero_point)
• Sometimes operators are aggressively fused dtype="uint8") / * ty=Tensor[(2, 5), uint8] */;
}
## QNN Conv2D Operator
## • Calculations are different from FP32 Conv2D
real_value = scale * (quantized_value - zero_point)
$$ \Sigma\mathrm{c} s\text\textcircled{z}p_{-}a\times\text\textcircled{z}p_{-}w\quad//Term4\\\end{array} $$
## Lowering of QNN Conv2D Operator
fn (%data: Tensor[(1, 3, 2, 3), uint8], %weight: Tensor[(3, 3, 2, 2), uint8]) {
qnn
0 码力 |
19 页 |
489.50 KB
| 1 年前 3
return num_features
net = Net()
print(net)
Net(
(conv1): Conv2d(1, 6, kernel_size=(5, 5), stride=(1, 1))
(conv2): Conv2d(6, 16, kernel_size=(5, 5), stride=(1, 1))
(fc1): Linear(in_features=400 )
现在,如果在反向过程中跟随 loss,使用它的 .grad fn 属性,将看到如下所示的计算图。
input -> conv2d -> relu -> maxpool2d -> conv2d -> relu -> maxpool2d
-> view -> linear -> relu -> linear ->
0 码力 |
7 页 |
370.53 KB
| 2 年前 3
manufacture a deep learning chip which achieves amazing performance on widely-used operators (e.g. conv2d, dense, ReLU, etc)
Now your customer wants to run a YOLO model, but...
 can be checked as well
def conv2d(attrs, args):
return is_float32(args)
Return True/False for this op
## After Annotation
(e.g., reused parameters)
• Multiple outputs (e.g., batch normalization)
Subgraph merging (e.g., conv2d + ReLU)
## System Overview
)(X)
# Apply a Conv2D that will transform it into data of dimensions (batchsize, time, 1, NumofFilters)
C = Conv2D(filters=init.CNNFilters
0 码力 |
17 页 |
2.49 MB
| 2 年前 3
CPU
CPU total % | CPU total | CPU time avg | # of Calls | | aten::conv2d | 0.11% | 276.000us | 93.66% | 228.600ms | 4.313ms | 53 | extension: warn(f"Failed to load image Python extension: {e}")
| aten::conv2d | 0.04% | 392.0 | Stage:2022-12-18 03:59:38 30:30 Activity:Profile 07% | 760.0 | |
| aten::thnn_conv2d | 0.03% | 364.0 | aten::conv2d | 0.07% | 398.000us | 82.34% | 460.282ms | 8.685ms | 53 | 0 码力 |
24 页 |
4.00 MB
| 2 年前 3
name="inputs")
# 第1层卷积
conv1 = Conv2D(32, (3, 3), name="conv1")(inputs)
relu1 = Activation('relu', name="relu1")(conv1)
# 第2层卷积
conv2 = Conv2D(32, (3, 3), name="conv2")(relu1) MaxPooling2D(pool_size=(2, 2), padding='same', name="pool2")(relu2)
# 第3层卷积
conv3 = Conv2D(64, (3, 3), name="conv3")(pool2)
relu3 = Activation('relu', name="relu3")(conv3)
0 码力 |
51 页 |
2.73 MB
| 2 年前 3