Hi,
I have a fully-connected CNN with the following architecture:
fcnn(
(conv1d_block1): Sequential(
(0): Conv1d(3, 128, kernel_size=(7,), stride=(1,), padding=(3,))
(1): BatchNorm1d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(2): ReLU()
)
(conv1d_block2): Sequential(
(0): Conv1d(128, 256, kernel_size=(5,), stride=(1,), padding=(2,))
(1): BatchNorm1d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(2): ReLU()
)
(conv1d_block3): Sequential(
(0): Conv1d(256, 128, kernel_size=(3,), stride=(1,), padding=(1,))
(1): BatchNorm1d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(2): ReLU()
)
(global_avg_pool): AvgPool1d(kernel_size=(1800,), stride=(1800,), padding=(0,))
(linear_1): Linear(in_features=128, out_features=1, bias=True)
(sigmoid): Sigmoid()
)
as you can see it does a binary classification.
so by doing a forward pass I would get a proba for the binary class in regard to the batch size.
I would also like to have access to the output of the global_avg_pool in my example, meaning I would like to have the following outout: (batch_size,128), meaning a feature representation learned by the network with size of 128.
how could this be accomplished?
thanks!