Skip to content

Commit

Permalink
ENH: removed weird self.verbose_iter_ attribute + added more explicit…
Browse files Browse the repository at this point in the history
…y controlled printing (for progress report)
  • Loading branch information
dohmatob committed Jan 31, 2017
1 parent 7a7be93 commit 143f297
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions modl/fmri.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,23 +326,16 @@ def fit(self, imgs=None, y=None, confounds=None, raw=False):
self.dict_fact_.prepare(n_samples=n_samples, n_features=n_voxels,
X=dict_init, dtype=dtype)

if self.verbose:
log_lim = log(n_records * self.n_epochs, 10)
self.verbose_iter_ = np.logspace(0, log_lim, self.verbose,
base=10) - 1
self.verbose_iter_ = self.verbose_iter_.tolist()
current_n_records = 0
for i in range(self.n_epochs):
if self.verbose:
print('Epoch %i' % (i + 1))
record_list = self.random_state.permutation(n_records)
for record in record_list:
if (self.verbose and self.verbose_iter_ and
current_n_records >= self.verbose_iter_[0]):
if self.verbose:
print('Record %i' % current_n_records)
if self.callback is not None:
self.callback(self)
self.verbose_iter_ = self.verbose_iter_[1:]
data = data_list[record]
sample_indices = np.arange(indices_list[record],
indices_list[record + 1])
Expand Down

0 comments on commit 143f297

Please sign in to comment.