02d76709c72932f75ad04b66fe2300f3c18611a2,pyprob/nn/embedding_cnn_2d_5c.py,EmbeddingCNN2D5C,__init__,#EmbeddingCNN2D5C#Any#Any#,8
Before Change
self._input_shape = input_shape // expecting 3d: [channels, height, width]
input_channels = input_shape[0]
self._output_shape = output_shape
self._output_dim = util.prod(output_shape)
self._conv1 = nn.Conv2d(input_channels, 64, 3)
self._conv2 = nn.Conv2d(64, 64, 3)
self._conv3 = nn.Conv2d(64, 128, 3)
self._conv4 = nn.Conv2d(128, 128, 3)
self._conv5 = nn.Conv2d(128, 128, 3)
cnn_output_dim = self._forward_cnn(torch.zeros(self._input_shape).unsqueeze(0)).nelement()
self._lin1 = nn.Linear(cnn_output_dim, self._output_dim)
self._lin2 = nn.Linear(self._output_dim, self._output_dim)
def _forward_cnn(self, x):
x = torch.relu(self._conv1(x))
After Change
def __init__(self, input_shape, output_shape):
super().__init__()
self._input_shape = util.to_size(input_shape) // expecting 3d: [channels, height, width]
self._output_shape = util.to_size(output_shape)
input_channels = self._input_shape[0]
self._output_dim = util.prod(self._output_shape)
self._conv1 = nn.Conv2d(input_channels, 64, 3)
self._conv2 = nn.Conv2d(64, 64, 3)
self._conv3 = nn.Conv2d(64, 128, 3)
self._conv4 = nn.Conv2d(128, 128, 3)
self._conv5 = nn.Conv2d(128, 128, 3)
cnn_output_dim = self._forward_cnn(torch.zeros(self._input_shape).unsqueeze(0)).nelement()
self._lin1 = nn.Linear(cnn_output_dim, self._output_dim)
self._lin2 = nn.Linear(self._output_dim, self._output_dim)
def _forward_cnn(self, x):
x = torch.relu(self._conv1(x))
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 6
Instances
Project Name: pyprob/pyprob
Commit Name: 02d76709c72932f75ad04b66fe2300f3c18611a2
Time: 2018-11-13
Author: atilimgunes.baydin@gmail.com
File Name: pyprob/nn/embedding_cnn_2d_5c.py
Class Name: EmbeddingCNN2D5C
Method Name: __init__
Project Name: pyprob/pyprob
Commit Name: 02d76709c72932f75ad04b66fe2300f3c18611a2
Time: 2018-11-13
Author: atilimgunes.baydin@gmail.com
File Name: pyprob/nn/embedding_cnn_3d_4c.py
Class Name: EmbeddingCNN3D4C
Method Name: __init__
Project Name: pyprob/pyprob
Commit Name: 02d76709c72932f75ad04b66fe2300f3c18611a2
Time: 2018-11-13
Author: atilimgunes.baydin@gmail.com
File Name: pyprob/nn/embedding_feedforward.py
Class Name: EmbeddingFeedForward
Method Name: __init__