def decampos_digits(data_set='<STR_LIT>', which_digits=[<NUM_LIT:0>,<NUM_LIT:1>,<NUM_LIT:2>,<NUM_LIT:3>,<NUM_LIT:4>,<NUM_LIT:5>,<NUM_LIT:6>,<NUM_LIT:7>,<NUM_LIT:8>,<NUM_LIT:9>]):
if not data_available(data_set):<EOL><INDENT>download_data(data_set)<EOL><DEDENT>path = os.path.join(data_path, data_set)<EOL>digits = np.load(os.path.join(path, '<STR_LIT>'))<EOL>digits = digits[which_digits,:,:,:]<EOL>num_classes, num_samples, height, width = digits.shape<EOL>Y = digits.reshape((digits.shape[<NUM_LIT:0>]*digits.shape[<NUM_LIT:1>],digits.shape[<NUM_LIT:2>]*digits.shape[<NUM_LIT:3>]))<EOL>lbls = np.array([[l]*num_samples for l in which_digits]).reshape(Y.shape[<NUM_LIT:0>], <NUM_LIT:1>)<EOL>str_lbls = np.array([[str(l)]*num_samples for l in which_digits])<EOL>return data_details_return({'<STR_LIT:Y>': Y, '<STR_LIT>': lbls, '<STR_LIT>' : str_lbls, '<STR_LIT:info>': '<STR_LIT>'}, data_set)<EOL>
Digits data set from Teo de Campos