Fitnet: Out of memory error solved by transposing?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Pelajar UM
el 18 de Oct. de 2021
Comentada: Pelajar UM
el 19 de Oct. de 2021
Here's the code:
net_set = fitnet (4, 'trainlm');
my_ANN = train (net_set, input,output)
Input and output both are 49736x3 arrays.
Here's the exact error:
Error using backpropJacobianStatic
Requested 447628x447628 (1492.9GB) array exceeds maximum array size preference (31.9GB). This might cause MATLAB to become
unresponsive.
When I transpose the arrays, it runs with no problems:
my_ANN = train (net_set, input.',output.')
0 comentarios
Respuesta aceptada
Chunru
el 19 de Oct. de 2021
Editada: Chunru
el 19 de Oct. de 2021
When you use "my_ANN = train (net_set, input,output)", your network will have a input/output size of 49736, which results in many weights in your network. If you use "my_ANN = train (net_set, input.',output.')", the network input/output size is only 3 and the weights in different layers are small so you can train the networkd with no problem.
net_set = fitnet (4, 'trainlm');
input = randn(49736, 3);
output = randn(49736, 3);
my_ANN = train (net_set, input',output');
% To see the trained network architecture
% view(my_ANN)
3 comentarios
Chunru
el 19 de Oct. de 2021
if you train the network with a set of 10 coordinates (10x3 inputs and 10x3 outputs), then you have a network with 10 inputs neurons, 4 hidden neurons, and 10 output neurons. There 4x10 weights between input and hidden layers, and 4x10 weights between hidden and output layers (ignoring the bias). So you have around 80 unknown weights. There are only 3 training samples. If the network were a linear one, you would have 3 equations with around 80 unknowns and the system would be under-determined. So you don't have enough train data to train the system in this case and hence the prediction can be any wild guess.
Más respuestas (0)
Ver también
Categorías
Más información sobre Sequence and Numeric Feature Data Workflows en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!