-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding gridsearch with parser to pysap #46
Conversation
…e to put reconstruct ??
… data is copied on disk, must be moved to ftp)
…dopt import ... Still not ready for PR
…ch example. Near ready to PR
finishing implementing gridsearch module
…of breaking line around binary operator
Pull Request Test Coverage Report for Build 130
💛 - Coveralls |
…f Sparse2D transforms. For now, there is still a bug unfound
update master on fork
merge master origin with upstream
Missing |
pysap/plugins/mri/gridsearch/data.py
Outdated
acc_factor=None): | ||
|
||
ref = get_sample_data("mri-slice-nifti") | ||
ref = _l2_normalize(ref.data) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should probably be
ref.data = _l2_normalize(ref.data)
info['mask_type'] = mask_type | ||
info['acc_factor'] = acc_factor | ||
|
||
return ref.astype("complex128"),\ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one also
return ref.data.astype("complex128"),\
pysap/plugins/mri/gridsearch/data.py
Outdated
# Sys import | ||
import os.path as osp | ||
|
||
import sys |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not used.
pysap/plugins/mri/gridsearch/data.py
Outdated
|
||
# Specific import | ||
from pysap.plugins.mri.reconstruct.utils import convert_mask_to_locations | ||
from pysap.plugins.mri.reconstruct.utils import convert_locations_to_mask |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also not used
pysap/plugins/mri/gridsearch/data.py
Outdated
|
||
_dirname_ = osp.dirname(osp.abspath(__file__)) | ||
_data_dirname_ = osp.join(_dirname_, "data") | ||
DATADIR = osp.join(osp.expanduser("~"), ".local", "share", "pysap") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason why you do not simply use the following?
_data_dirname_ = osp.join(osp.expanduser("~"), ".local", "share", "pysap")
import logging | ||
|
||
import argparse | ||
import itertools |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not used
import itertools | ||
|
||
# Third party import | ||
import requests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not used
# Third party import | ||
import requests | ||
import numpy as np | ||
import matplotlib.pylab as plt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not used
WARNING: This code must be reviewed after PR #22 of Modopt package have been accepted. Also, it needs some data in .local/share/pysap, which can't be download for now from ftp.
Modifications
Thoses changes allows to use a gridsearch wrapper (in base/gridsearch) to multi-thread reconstructions on several parameters (passed as arrays) and also compute multiple metrics at once.
A working example is set in examples/ dir, it is really the main scripts of study_launcher.py and post_processing.py concatenated in one file. Read README in gridsearch plugin to see how it works.
Quickly, the principle is that study_launcher.py parses the config.ini file, with lists of parameters and metrics to try on the gridsearch. Then, the gridsearch is called on one of the reconstruction function. Results are stored in results/ folder and the post_processing.py script reads it, and compute statistics over it.