-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Ragav Venkatesan
committed
Feb 10, 2017
1 parent
76490a9
commit 08d599f
Showing
4 changed files
with
83 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,4 +15,4 @@ | |
/visualizer | ||
/lenet5 | ||
.vscode | ||
.yann_data | ||
svhn |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
""" | ||
This is a tutorial to setup any dataset in matlab format to be used by YANN. | ||
Still working on this. | ||
""" | ||
def cook_svhn_normalized( location, verbose = 1, **kwargs): | ||
""" | ||
This method demonstrates how to cook a dataset for yann from matlab. | ||
Args: | ||
location: provide the location where the dataset is created and stored. | ||
Refer to prepare_svhn.m file to understand how to prepare a dataset. | ||
save_directory: which directory to save the cooked dataset onto. | ||
dataset_parms: default is the dictionary. Refer to :mod:`setup_dataset` | ||
preprocess_params: default is the dictionary. Refer to :mod:`setup_dataset`. | ||
Notes: | ||
By default, this will create a dataset that is not mean-subtracted. | ||
""" | ||
|
||
if not 'save_directory' in kwargs.keys(): | ||
save_directory = '_datasets' | ||
else: | ||
save_directory = kwargs ['save_directory'] | ||
|
||
if not 'data_params' in kwargs.keys(): | ||
|
||
data_params = { | ||
"source" : 'mat', | ||
"name" : 'yann_svhn', | ||
"location" : location, | ||
"height" : 32, | ||
"width" : 32, | ||
"channels" : 3 } | ||
|
||
else: | ||
data_params = kwargs['data_params'] | ||
|
||
if not 'preprocess_params' in kwargs.keys(): | ||
|
||
# parameters relating to preprocessing. | ||
preprocess_params = { | ||
"normalize" : True, | ||
"ZCA" : False, | ||
"grayscale" : False, | ||
"zero_mean" : False, | ||
} | ||
else: | ||
preprocess_params = kwargs['preprocess_params'] | ||
|
||
dataset = setup_dataset(dataset_init_args = data_params, | ||
save_directory = save_directory, | ||
preprocess_init_args = preprocess_params, | ||
verbose = 3) | ||
return dataset |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters