how to convert this block of code to python?
Ältere Kommentare anzeigen
%convert the weights to -1 and + 1. Store in single because conv2 requires it
for i = 1:length(Filters)
Filters{i} = gpuArray(2*(single(sign(Filters{i}))-0.5));
NumLearntWeightsEachLayer(i) = size(Filters{i},3)*size(Filters{i},4)*4;
end
NumLearntWeightsEachLayer(end) = size(Filters{end},3)*size(Filters{end},4);
NumLearntWeightsEachLayer
TotalLearntWeights = sum(NumLearntWeightsEachLayer)
4 Kommentare
Prb
am 19 Apr. 2019
Prb
am 1 Mai 2019
Walter Roberson
am 1 Mai 2019
https://stackoverflow.com/questions/40609838/what-is-the-equivalent-to-a-matlab-cell-array
Antworten (1)
Prb
am 1 Mai 2019
0 Stimmen
Kategorien
Mehr zu Language Support finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!