Why is the running time greatly increased after using Ctrl+C on a neural network?

I'm using a neural network with autoencoders to classify images. The first time I ran the code, it took 1 hour. After multiple times of running and aborting the program midway using Ctrl+C, I've noticed the same code takes much longer to run, or won't run at all (with the error being that there is not enough memory space). I manually deleted the files in the tempdir directory thinking that maybe matlab was saving variables in the temporary file and wasn't clearing them out after ctrl+c. The program now runs for 2 1/2 hours. Any idea why this is happening and how I can get back to the 1 hour run time? Thanks!

Answers (1)

close('all')
clear all
delete( findall(0, 'type', 'figure') )
pack

4 Comments

I am more than a little confused:
1. How does close('all') differ from close all?
The former is not in the help or doc descriptions
2. How does clear all differ from
clear('all')?
3. Why is the delete statement needed?
Glassy eyed,
Greg
close all is the "command function equivalence" form of close('all'), and clear all is the "command function equivalence" of clear('all') . That is, anything of the form
FunctionName Word
is equivalent to calling FunctionName('Word')
The delete statement is there to get rid of any active graphics, as clear all does not remove graphics.
I thought close all removed graphics.
I generally start my programs with
close all, clear all, clc, tic
Any comments or suggestions re this?
Greg
I was confusing close with fclose.
fclose all
close all hidden
I never use "clear all" though: it clears too much.

Sign in to comment.

Asked:

on 16 May 2016

Commented:

on 20 May 2016

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!