MCPcopy Index your code
hub / github.com/TheAlgorithms/Python / _expand

Method _expand

neural_network/convolution_neural_network.py:169–178  ·  view source on GitHub ↗
(self, data)

Source from the content-addressed store, hash-verified

167 return featuremap_pooled
168
169 def _expand(self, data):
170 # expanding three dimension data to one dimension list
171 data_expanded = []
172 for i in range(len(data)):
173 shapes = np.shape(data[i])
174 data_listed = data[i].reshape(1, shapes[0] * shapes[1])
175 data_listed = data_listed.getA().tolist()[0]
176 data_expanded.extend(data_listed)
177 data_expanded = np.asarray(data_expanded)
178 return data_expanded
179
180 def _expand_mat(self, data_mat):
181 # expanding matrix to one dimension list

Callers 2

trainMethod · 0.95
predictMethod · 0.95

Calls 1

extendMethod · 0.45

Tested by

no test coverage detected