mlpack 4.6.2__cp39-cp39-win_amd64.whl → 4.7.0__cp39-cp39-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- mlpack/__init__.py +6 -6
- mlpack/adaboost_classify.cp39-win_amd64.pyd +0 -0
- mlpack/adaboost_probabilities.cp39-win_amd64.pyd +0 -0
- mlpack/adaboost_train.cp39-win_amd64.pyd +0 -0
- mlpack/approx_kfn.cp39-win_amd64.pyd +0 -0
- mlpack/arma_numpy.cp39-win_amd64.pyd +0 -0
- mlpack/bayesian_linear_regression.cp39-win_amd64.pyd +0 -0
- mlpack/cf.cp39-win_amd64.pyd +0 -0
- mlpack/dbscan.cp39-win_amd64.pyd +0 -0
- mlpack/decision_tree.cp39-win_amd64.pyd +0 -0
- mlpack/det.cp39-win_amd64.pyd +0 -0
- mlpack/emst.cp39-win_amd64.pyd +0 -0
- mlpack/fastmks.cp39-win_amd64.pyd +0 -0
- mlpack/gmm_generate.cp39-win_amd64.pyd +0 -0
- mlpack/gmm_probability.cp39-win_amd64.pyd +0 -0
- mlpack/gmm_train.cp39-win_amd64.pyd +0 -0
- mlpack/hmm_generate.cp39-win_amd64.pyd +0 -0
- mlpack/hmm_loglik.cp39-win_amd64.pyd +0 -0
- mlpack/hmm_train.cp39-win_amd64.pyd +0 -0
- mlpack/hmm_viterbi.cp39-win_amd64.pyd +0 -0
- mlpack/hoeffding_tree.cp39-win_amd64.pyd +0 -0
- mlpack/image_converter.cp39-win_amd64.pyd +0 -0
- mlpack/include/mlpack/base.hpp +1 -0
- mlpack/include/mlpack/core/arma_extend/find_nan.hpp +63 -0
- mlpack/include/mlpack/core/cereal/low_precision.hpp +48 -0
- mlpack/include/mlpack/core/cv/cv_base.hpp +11 -11
- mlpack/include/mlpack/core/cv/cv_base_impl.hpp +7 -7
- mlpack/include/mlpack/core/cv/k_fold_cv.hpp +4 -4
- mlpack/include/mlpack/core/cv/k_fold_cv_impl.hpp +4 -4
- mlpack/include/mlpack/core/cv/meta_info_extractor.hpp +10 -10
- mlpack/include/mlpack/core/cv/metrics/f1_impl.hpp +1 -1
- mlpack/include/mlpack/core/cv/metrics/facilities.hpp +2 -1
- mlpack/include/mlpack/core/cv/metrics/precision_impl.hpp +1 -1
- mlpack/include/mlpack/core/cv/metrics/r2_score_impl.hpp +1 -1
- mlpack/include/mlpack/core/cv/metrics/silhouette_score_impl.hpp +1 -1
- mlpack/include/mlpack/core/cv/simple_cv.hpp +4 -4
- mlpack/include/mlpack/core/cv/simple_cv_impl.hpp +2 -2
- mlpack/include/mlpack/core/data/binarize.hpp +0 -2
- mlpack/include/mlpack/core/data/check_categorical_param.hpp +0 -2
- mlpack/include/mlpack/core/data/combine_options.hpp +151 -0
- mlpack/include/mlpack/core/data/confusion_matrix.hpp +0 -2
- mlpack/include/mlpack/core/data/confusion_matrix_impl.hpp +0 -2
- mlpack/include/mlpack/core/data/data.hpp +6 -4
- mlpack/include/mlpack/core/data/data_options.hpp +341 -18
- mlpack/include/mlpack/core/data/dataset_mapper.hpp +3 -5
- mlpack/include/mlpack/core/data/dataset_mapper_impl.hpp +0 -2
- mlpack/include/mlpack/core/data/detect_file_type.hpp +34 -5
- mlpack/include/mlpack/core/data/detect_file_type_impl.hpp +185 -11
- mlpack/include/mlpack/core/data/extension.hpp +2 -4
- mlpack/include/mlpack/core/data/font8x8_basic.h +152 -0
- mlpack/include/mlpack/core/data/has_serialize.hpp +0 -2
- mlpack/include/mlpack/core/data/image_bounding_box.hpp +36 -0
- mlpack/include/mlpack/core/data/image_bounding_box_impl.hpp +155 -0
- mlpack/include/mlpack/core/data/image_layout.hpp +63 -0
- mlpack/include/mlpack/core/data/image_layout_impl.hpp +75 -0
- mlpack/include/mlpack/core/data/image_letterbox.hpp +116 -0
- mlpack/include/mlpack/core/data/image_options.hpp +257 -0
- mlpack/include/mlpack/core/data/image_resize_crop.hpp +113 -48
- mlpack/include/mlpack/core/data/imputation_methods/custom_imputation.hpp +16 -32
- mlpack/include/mlpack/core/data/imputation_methods/listwise_deletion.hpp +19 -29
- mlpack/include/mlpack/core/data/imputation_methods/mean_imputation.hpp +113 -44
- mlpack/include/mlpack/core/data/imputation_methods/median_imputation.hpp +44 -43
- mlpack/include/mlpack/core/data/imputer.hpp +41 -49
- mlpack/include/mlpack/core/data/is_naninf.hpp +0 -2
- mlpack/include/mlpack/core/data/load.hpp +49 -233
- mlpack/include/mlpack/core/data/load_arff.hpp +0 -2
- mlpack/include/mlpack/core/data/load_arff_impl.hpp +2 -4
- mlpack/include/mlpack/core/data/load_categorical.hpp +1 -4
- mlpack/include/mlpack/core/data/load_categorical_impl.hpp +10 -26
- mlpack/include/mlpack/core/data/load_dense.hpp +279 -0
- mlpack/include/mlpack/core/data/load_deprecated.hpp +466 -0
- mlpack/include/mlpack/core/data/load_image.hpp +71 -43
- mlpack/include/mlpack/core/data/load_impl.hpp +95 -274
- mlpack/include/mlpack/core/data/load_model.hpp +62 -0
- mlpack/include/mlpack/core/data/load_numeric.hpp +124 -87
- mlpack/include/mlpack/core/data/load_sparse.hpp +91 -0
- mlpack/include/mlpack/core/data/map_policies/datatype.hpp +0 -2
- mlpack/include/mlpack/core/data/map_policies/increment_policy.hpp +0 -2
- mlpack/include/mlpack/core/data/map_policies/map_policies.hpp +0 -1
- mlpack/include/mlpack/core/data/matrix_options.hpp +152 -20
- mlpack/include/mlpack/core/data/normalize_labels.hpp +0 -2
- mlpack/include/mlpack/core/data/normalize_labels_impl.hpp +0 -2
- mlpack/include/mlpack/core/data/one_hot_encoding.hpp +2 -4
- mlpack/include/mlpack/core/data/one_hot_encoding_impl.hpp +3 -5
- mlpack/include/mlpack/core/data/save.hpp +26 -120
- mlpack/include/mlpack/core/data/save_dense.hpp +42 -0
- mlpack/include/mlpack/core/data/save_deprecated.hpp +308 -0
- mlpack/include/mlpack/core/data/save_image.hpp +82 -42
- mlpack/include/mlpack/core/data/save_impl.hpp +60 -245
- mlpack/include/mlpack/core/data/save_matrix.hpp +45 -0
- mlpack/include/mlpack/core/data/save_model.hpp +61 -0
- mlpack/include/mlpack/core/data/save_numeric.hpp +60 -0
- mlpack/include/mlpack/core/data/save_sparse.hpp +44 -0
- mlpack/include/mlpack/core/data/scaler_methods/max_abs_scaler.hpp +0 -2
- mlpack/include/mlpack/core/data/scaler_methods/mean_normalization.hpp +2 -4
- mlpack/include/mlpack/core/data/scaler_methods/min_max_scaler.hpp +0 -2
- mlpack/include/mlpack/core/data/scaler_methods/pca_whitening.hpp +1 -3
- mlpack/include/mlpack/core/data/scaler_methods/standard_scaler.hpp +2 -4
- mlpack/include/mlpack/core/data/scaler_methods/zca_whitening.hpp +0 -2
- mlpack/include/mlpack/core/data/split_data.hpp +6 -8
- mlpack/include/mlpack/core/data/string_algorithms.hpp +0 -2
- mlpack/include/mlpack/core/data/string_encoding.hpp +0 -2
- mlpack/include/mlpack/core/data/string_encoding_dictionary.hpp +0 -2
- mlpack/include/mlpack/core/data/string_encoding_impl.hpp +0 -2
- mlpack/include/mlpack/core/data/string_encoding_policies/bag_of_words_encoding_policy.hpp +0 -2
- mlpack/include/mlpack/core/data/string_encoding_policies/dictionary_encoding_policy.hpp +0 -2
- mlpack/include/mlpack/core/data/string_encoding_policies/policy_traits.hpp +0 -2
- mlpack/include/mlpack/core/data/string_encoding_policies/tf_idf_encoding_policy.hpp +0 -2
- mlpack/include/mlpack/core/data/text_options.hpp +91 -53
- mlpack/include/mlpack/core/data/tokenizers/char_extract.hpp +0 -2
- mlpack/include/mlpack/core/data/tokenizers/split_by_any_of.hpp +0 -2
- mlpack/include/mlpack/core/distributions/gamma_distribution_impl.hpp +4 -4
- mlpack/include/mlpack/core/distributions/laplace_distribution.hpp +9 -9
- mlpack/include/mlpack/core/distributions/laplace_distribution_impl.hpp +7 -7
- mlpack/include/mlpack/core/hpt/cv_function.hpp +2 -2
- mlpack/include/mlpack/core/hpt/cv_function_impl.hpp +2 -2
- mlpack/include/mlpack/core/hpt/hpt.hpp +4 -4
- mlpack/include/mlpack/core/hpt/hpt_impl.hpp +9 -9
- mlpack/include/mlpack/core/math/make_alias.hpp +7 -5
- mlpack/include/mlpack/core/math/random.hpp +19 -5
- mlpack/include/mlpack/core/math/shuffle_data.hpp +79 -245
- mlpack/include/mlpack/core/metrics/non_maximal_suppression_impl.hpp +9 -10
- mlpack/include/mlpack/core/stb/bundled/stb_image_resize2.h +291 -239
- mlpack/include/mlpack/core/tree/binary_space_tree/rp_tree_mean_split_impl.hpp +7 -7
- mlpack/include/mlpack/core/tree/cellbound.hpp +2 -2
- mlpack/include/mlpack/core/tree/cosine_tree/cosine_tree_impl.hpp +10 -10
- mlpack/include/mlpack/core/tree/octree/octree.hpp +10 -0
- mlpack/include/mlpack/core/tree/octree/octree_impl.hpp +14 -4
- mlpack/include/mlpack/core/util/arma_traits.hpp +25 -38
- mlpack/include/mlpack/core/util/coot_traits.hpp +97 -0
- mlpack/include/mlpack/core/util/forward.hpp +0 -2
- mlpack/include/mlpack/core/util/param.hpp +4 -4
- mlpack/include/mlpack/core/util/params_impl.hpp +2 -2
- mlpack/include/mlpack/core/util/using.hpp +29 -2
- mlpack/include/mlpack/core/util/version.hpp +5 -3
- mlpack/include/mlpack/core/util/version_impl.hpp +3 -6
- mlpack/include/mlpack/methods/adaboost/adaboost_classify_main.cpp +1 -1
- mlpack/include/mlpack/methods/adaboost/adaboost_main.cpp +3 -3
- mlpack/include/mlpack/methods/adaboost/adaboost_train_main.cpp +2 -2
- mlpack/include/mlpack/methods/ann/activation_functions/activation_functions.hpp +1 -0
- mlpack/include/mlpack/methods/ann/activation_functions/bipolar_sigmoid_function.hpp +6 -4
- mlpack/include/mlpack/methods/ann/activation_functions/elish_function.hpp +17 -12
- mlpack/include/mlpack/methods/ann/activation_functions/elliot_function.hpp +9 -7
- mlpack/include/mlpack/methods/ann/activation_functions/gaussian_function.hpp +7 -6
- mlpack/include/mlpack/methods/ann/activation_functions/gelu_exact_function.hpp +73 -0
- mlpack/include/mlpack/methods/ann/activation_functions/gelu_function.hpp +27 -16
- mlpack/include/mlpack/methods/ann/activation_functions/hard_sigmoid_function.hpp +8 -6
- mlpack/include/mlpack/methods/ann/activation_functions/hard_swish_function.hpp +6 -4
- mlpack/include/mlpack/methods/ann/activation_functions/hyper_sinh_function.hpp +13 -8
- mlpack/include/mlpack/methods/ann/activation_functions/identity_function.hpp +6 -4
- mlpack/include/mlpack/methods/ann/activation_functions/inverse_quadratic_function.hpp +8 -6
- mlpack/include/mlpack/methods/ann/activation_functions/lisht_function.hpp +7 -5
- mlpack/include/mlpack/methods/ann/activation_functions/logistic_function.hpp +14 -12
- mlpack/include/mlpack/methods/ann/activation_functions/mish_function.hpp +7 -5
- mlpack/include/mlpack/methods/ann/activation_functions/multi_quadratic_function.hpp +6 -4
- mlpack/include/mlpack/methods/ann/activation_functions/poisson1_function.hpp +4 -2
- mlpack/include/mlpack/methods/ann/activation_functions/quadratic_function.hpp +6 -4
- mlpack/include/mlpack/methods/ann/activation_functions/rectifier_function.hpp +10 -10
- mlpack/include/mlpack/methods/ann/activation_functions/silu_function.hpp +10 -8
- mlpack/include/mlpack/methods/ann/activation_functions/softplus_function.hpp +12 -9
- mlpack/include/mlpack/methods/ann/activation_functions/softsign_function.hpp +15 -23
- mlpack/include/mlpack/methods/ann/activation_functions/spline_function.hpp +9 -7
- mlpack/include/mlpack/methods/ann/activation_functions/swish_function.hpp +11 -9
- mlpack/include/mlpack/methods/ann/activation_functions/tanh_exponential_function.hpp +9 -7
- mlpack/include/mlpack/methods/ann/activation_functions/tanh_function.hpp +10 -7
- mlpack/include/mlpack/methods/ann/ann.hpp +3 -0
- mlpack/include/mlpack/methods/ann/convolution_rules/base_convolution.hpp +197 -0
- mlpack/include/mlpack/methods/ann/convolution_rules/convolution_rules.hpp +1 -2
- mlpack/include/mlpack/methods/ann/convolution_rules/im2col_convolution.hpp +215 -0
- mlpack/include/mlpack/methods/ann/convolution_rules/naive_convolution.hpp +109 -154
- mlpack/include/mlpack/methods/ann/dag_network.hpp +728 -0
- mlpack/include/mlpack/methods/ann/dag_network_impl.hpp +1640 -0
- mlpack/include/mlpack/methods/ann/dists/bernoulli_distribution_impl.hpp +1 -1
- mlpack/include/mlpack/methods/ann/dists/normal_distribution_impl.hpp +7 -2
- mlpack/include/mlpack/methods/ann/ffn.hpp +39 -3
- mlpack/include/mlpack/methods/ann/ffn_impl.hpp +14 -32
- mlpack/include/mlpack/methods/ann/init_rules/const_init.hpp +4 -4
- mlpack/include/mlpack/methods/ann/init_rules/gaussian_init.hpp +6 -2
- mlpack/include/mlpack/methods/ann/init_rules/he_init.hpp +4 -2
- mlpack/include/mlpack/methods/ann/init_rules/kathirvalavakumar_subavathi_init.hpp +3 -3
- mlpack/include/mlpack/methods/ann/init_rules/lecun_normal_init.hpp +4 -2
- mlpack/include/mlpack/methods/ann/init_rules/nguyen_widrow_init.hpp +2 -2
- mlpack/include/mlpack/methods/ann/init_rules/oivs_init.hpp +2 -2
- mlpack/include/mlpack/methods/ann/init_rules/orthogonal_init.hpp +2 -2
- mlpack/include/mlpack/methods/ann/init_rules/random_init.hpp +8 -4
- mlpack/include/mlpack/methods/ann/layer/adaptive_max_pooling.hpp +21 -23
- mlpack/include/mlpack/methods/ann/layer/adaptive_max_pooling_impl.hpp +15 -15
- mlpack/include/mlpack/methods/ann/layer/adaptive_mean_pooling.hpp +21 -23
- mlpack/include/mlpack/methods/ann/layer/adaptive_mean_pooling_impl.hpp +16 -16
- mlpack/include/mlpack/methods/ann/layer/add.hpp +18 -18
- mlpack/include/mlpack/methods/ann/layer/add_impl.hpp +13 -13
- mlpack/include/mlpack/methods/ann/layer/add_merge.hpp +19 -18
- mlpack/include/mlpack/methods/ann/layer/add_merge_impl.hpp +13 -13
- mlpack/include/mlpack/methods/ann/layer/alpha_dropout.hpp +17 -16
- mlpack/include/mlpack/methods/ann/layer/alpha_dropout_impl.hpp +14 -13
- mlpack/include/mlpack/methods/ann/layer/base_layer.hpp +28 -51
- mlpack/include/mlpack/methods/ann/layer/batch_norm.hpp +16 -18
- mlpack/include/mlpack/methods/ann/layer/batch_norm_impl.hpp +55 -54
- mlpack/include/mlpack/methods/ann/layer/c_relu.hpp +18 -20
- mlpack/include/mlpack/methods/ann/layer/c_relu_impl.hpp +20 -25
- mlpack/include/mlpack/methods/ann/layer/celu.hpp +14 -19
- mlpack/include/mlpack/methods/ann/layer/celu_impl.hpp +25 -34
- mlpack/include/mlpack/methods/ann/layer/concat.hpp +18 -18
- mlpack/include/mlpack/methods/ann/layer/concat_impl.hpp +13 -13
- mlpack/include/mlpack/methods/ann/layer/concatenate.hpp +18 -18
- mlpack/include/mlpack/methods/ann/layer/concatenate_impl.hpp +14 -14
- mlpack/include/mlpack/methods/ann/layer/convolution.hpp +42 -47
- mlpack/include/mlpack/methods/ann/layer/convolution_impl.hpp +170 -159
- mlpack/include/mlpack/methods/ann/layer/dropconnect.hpp +18 -20
- mlpack/include/mlpack/methods/ann/layer/dropconnect_impl.hpp +20 -20
- mlpack/include/mlpack/methods/ann/layer/dropout.hpp +17 -19
- mlpack/include/mlpack/methods/ann/layer/dropout_impl.hpp +14 -21
- mlpack/include/mlpack/methods/ann/layer/elu.hpp +23 -25
- mlpack/include/mlpack/methods/ann/layer/elu_impl.hpp +20 -27
- mlpack/include/mlpack/methods/ann/layer/embedding.hpp +160 -0
- mlpack/include/mlpack/methods/ann/layer/embedding_impl.hpp +189 -0
- mlpack/include/mlpack/methods/ann/layer/flexible_relu.hpp +17 -19
- mlpack/include/mlpack/methods/ann/layer/flexible_relu_impl.hpp +20 -20
- mlpack/include/mlpack/methods/ann/layer/ftswish.hpp +17 -18
- mlpack/include/mlpack/methods/ann/layer/ftswish_impl.hpp +17 -35
- mlpack/include/mlpack/methods/ann/layer/grouped_convolution.hpp +27 -33
- mlpack/include/mlpack/methods/ann/layer/grouped_convolution_impl.hpp +170 -163
- mlpack/include/mlpack/methods/ann/layer/gru.hpp +195 -0
- mlpack/include/mlpack/methods/ann/layer/gru_impl.hpp +325 -0
- mlpack/include/mlpack/methods/ann/layer/hard_tanh.hpp +13 -15
- mlpack/include/mlpack/methods/ann/layer/hard_tanh_impl.hpp +12 -12
- mlpack/include/mlpack/methods/ann/layer/identity.hpp +19 -20
- mlpack/include/mlpack/methods/ann/layer/identity_impl.hpp +12 -12
- mlpack/include/mlpack/methods/ann/layer/layer.hpp +37 -33
- mlpack/include/mlpack/methods/ann/layer/layer_norm.hpp +11 -13
- mlpack/include/mlpack/methods/ann/layer/layer_norm_impl.hpp +16 -16
- mlpack/include/mlpack/methods/ann/layer/layer_types.hpp +4 -1
- mlpack/include/mlpack/methods/ann/layer/leaky_relu.hpp +20 -23
- mlpack/include/mlpack/methods/ann/layer/leaky_relu_impl.hpp +12 -13
- mlpack/include/mlpack/methods/ann/layer/linear.hpp +16 -18
- mlpack/include/mlpack/methods/ann/layer/linear3d.hpp +18 -18
- mlpack/include/mlpack/methods/ann/layer/linear3d_impl.hpp +18 -18
- mlpack/include/mlpack/methods/ann/layer/linear_impl.hpp +15 -15
- mlpack/include/mlpack/methods/ann/layer/linear_no_bias.hpp +15 -17
- mlpack/include/mlpack/methods/ann/layer/linear_no_bias_impl.hpp +20 -20
- mlpack/include/mlpack/methods/ann/layer/linear_recurrent.hpp +25 -14
- mlpack/include/mlpack/methods/ann/layer/linear_recurrent_impl.hpp +60 -31
- mlpack/include/mlpack/methods/ann/layer/log_softmax.hpp +17 -36
- mlpack/include/mlpack/methods/ann/layer/log_softmax_impl.hpp +58 -74
- mlpack/include/mlpack/methods/ann/layer/lstm.hpp +26 -29
- mlpack/include/mlpack/methods/ann/layer/lstm_impl.hpp +128 -124
- mlpack/include/mlpack/methods/ann/layer/max_pooling.hpp +19 -19
- mlpack/include/mlpack/methods/ann/layer/max_pooling_impl.hpp +14 -14
- mlpack/include/mlpack/methods/ann/layer/mean_pooling.hpp +24 -24
- mlpack/include/mlpack/methods/ann/layer/mean_pooling_impl.hpp +16 -16
- mlpack/include/mlpack/methods/ann/layer/multi_layer.hpp +36 -6
- mlpack/include/mlpack/methods/ann/layer/multi_layer_impl.hpp +6 -2
- mlpack/include/mlpack/methods/ann/layer/multihead_attention.hpp +26 -22
- mlpack/include/mlpack/methods/ann/layer/multihead_attention_impl.hpp +161 -64
- mlpack/include/mlpack/methods/ann/layer/nearest_interpolation.hpp +28 -25
- mlpack/include/mlpack/methods/ann/layer/nearest_interpolation_impl.hpp +36 -37
- mlpack/include/mlpack/methods/ann/layer/noisylinear.hpp +39 -42
- mlpack/include/mlpack/methods/ann/layer/noisylinear_impl.hpp +18 -18
- mlpack/include/mlpack/methods/ann/layer/padding.hpp +21 -17
- mlpack/include/mlpack/methods/ann/layer/padding_impl.hpp +33 -19
- mlpack/include/mlpack/methods/ann/layer/parametric_relu.hpp +26 -28
- mlpack/include/mlpack/methods/ann/layer/parametric_relu_impl.hpp +18 -18
- mlpack/include/mlpack/methods/ann/layer/radial_basis_function.hpp +41 -28
- mlpack/include/mlpack/methods/ann/layer/radial_basis_function_impl.hpp +42 -17
- mlpack/include/mlpack/methods/ann/layer/recurrent_layer.hpp +13 -0
- mlpack/include/mlpack/methods/ann/layer/relu6.hpp +19 -21
- mlpack/include/mlpack/methods/ann/layer/relu6_impl.hpp +14 -14
- mlpack/include/mlpack/methods/ann/layer/repeat.hpp +24 -25
- mlpack/include/mlpack/methods/ann/layer/repeat_impl.hpp +10 -10
- mlpack/include/mlpack/methods/ann/layer/serialization.hpp +64 -54
- mlpack/include/mlpack/methods/ann/layer/softmax.hpp +20 -20
- mlpack/include/mlpack/methods/ann/layer/softmax_impl.hpp +10 -10
- mlpack/include/mlpack/methods/ann/layer/softmin.hpp +20 -23
- mlpack/include/mlpack/methods/ann/layer/softmin_impl.hpp +10 -10
- mlpack/include/mlpack/methods/ann/layer/sum_reduce.hpp +103 -0
- mlpack/include/mlpack/methods/ann/layer/sum_reduce_impl.hpp +143 -0
- mlpack/include/mlpack/methods/ann/loss_functions/cosine_embedding_loss_impl.hpp +3 -3
- mlpack/include/mlpack/methods/ann/loss_functions/mean_bias_error_impl.hpp +1 -1
- mlpack/include/mlpack/methods/ann/loss_functions/multilabel_softmargin_loss_impl.hpp +1 -1
- mlpack/include/mlpack/methods/ann/loss_functions/negative_log_likelihood.hpp +2 -2
- mlpack/include/mlpack/methods/ann/loss_functions/negative_log_likelihood_impl.hpp +29 -15
- mlpack/include/mlpack/methods/ann/loss_functions/poisson_nll_loss_impl.hpp +1 -1
- mlpack/include/mlpack/methods/ann/models/models.hpp +17 -0
- mlpack/include/mlpack/methods/ann/models/yolov3/yolov3_layer.hpp +151 -0
- mlpack/include/mlpack/methods/ann/models/yolov3/yolov3_layer_impl.hpp +265 -0
- mlpack/include/mlpack/methods/ann/models/yolov3/yolov3_tiny.hpp +187 -0
- mlpack/include/mlpack/methods/ann/models/yolov3/yolov3_tiny_impl.hpp +206 -0
- mlpack/include/mlpack/methods/ann/regularizer/orthogonal_regularizer_impl.hpp +5 -3
- mlpack/include/mlpack/methods/ann/rnn.hpp +136 -42
- mlpack/include/mlpack/methods/ann/rnn_impl.hpp +230 -38
- mlpack/include/mlpack/methods/approx_kfn/drusilla_select_impl.hpp +1 -1
- mlpack/include/mlpack/methods/bayesian_linear_regression/bayesian_linear_regression_main.cpp +1 -1
- mlpack/include/mlpack/methods/bias_svd/bias_svd_function_impl.hpp +1 -1
- mlpack/include/mlpack/methods/cf/cf_model.hpp +1 -1
- mlpack/include/mlpack/methods/decision_tree/decision_tree.hpp +6 -6
- mlpack/include/mlpack/methods/decision_tree/decision_tree_impl.hpp +12 -12
- mlpack/include/mlpack/methods/decision_tree/decision_tree_main.cpp +0 -1
- mlpack/include/mlpack/methods/decision_tree/decision_tree_regressor.hpp +6 -6
- mlpack/include/mlpack/methods/decision_tree/decision_tree_regressor_impl.hpp +12 -12
- mlpack/include/mlpack/methods/det/det_main.cpp +1 -1
- mlpack/include/mlpack/methods/hmm/hmm_train_main.cpp +4 -4
- mlpack/include/mlpack/methods/hmm/hmm_util_impl.hpp +2 -2
- mlpack/include/mlpack/methods/hoeffding_trees/hoeffding_tree.hpp +6 -6
- mlpack/include/mlpack/methods/hoeffding_trees/hoeffding_tree_impl.hpp +31 -31
- mlpack/include/mlpack/methods/hoeffding_trees/hoeffding_tree_main.cpp +1 -2
- mlpack/include/mlpack/methods/hoeffding_trees/hoeffding_tree_model.hpp +2 -2
- mlpack/include/mlpack/methods/hoeffding_trees/hoeffding_tree_model_impl.hpp +1 -1
- mlpack/include/mlpack/methods/kde/kde_rules_impl.hpp +6 -6
- mlpack/include/mlpack/methods/lars/lars_impl.hpp +3 -3
- mlpack/include/mlpack/methods/linear_svm/linear_svm_function_impl.hpp +4 -4
- mlpack/include/mlpack/methods/linear_svm/linear_svm_main.cpp +3 -3
- mlpack/include/mlpack/methods/lmnn/lmnn_main.cpp +1 -1
- mlpack/include/mlpack/methods/lsh/lsh_main.cpp +1 -1
- mlpack/include/mlpack/methods/matrix_completion/matrix_completion_impl.hpp +1 -1
- mlpack/include/mlpack/methods/naive_bayes/naive_bayes_classifier_impl.hpp +1 -1
- mlpack/include/mlpack/methods/naive_bayes/nbc_main.cpp +3 -3
- mlpack/include/mlpack/methods/nca/nca_main.cpp +1 -1
- mlpack/include/mlpack/methods/neighbor_search/kfn_main.cpp +8 -8
- mlpack/include/mlpack/methods/neighbor_search/knn_main.cpp +8 -8
- mlpack/include/mlpack/methods/neighbor_search/neighbor_search.hpp +154 -34
- mlpack/include/mlpack/methods/neighbor_search/neighbor_search_impl.hpp +190 -51
- mlpack/include/mlpack/methods/neighbor_search/neighbor_search_stat.hpp +10 -0
- mlpack/include/mlpack/methods/neighbor_search/ns_model.hpp +15 -15
- mlpack/include/mlpack/methods/neighbor_search/ns_model_impl.hpp +55 -46
- mlpack/include/mlpack/methods/neighbor_search/typedef.hpp +42 -2
- mlpack/include/mlpack/methods/pca/pca_impl.hpp +2 -2
- mlpack/include/mlpack/methods/perceptron/perceptron.hpp +2 -2
- mlpack/include/mlpack/methods/perceptron/perceptron_impl.hpp +1 -1
- mlpack/include/mlpack/methods/perceptron/perceptron_main.cpp +2 -2
- mlpack/include/mlpack/methods/preprocess/image_converter_main.cpp +2 -3
- mlpack/include/mlpack/methods/preprocess/preprocess_binarize_main.cpp +2 -2
- mlpack/include/mlpack/methods/preprocess/preprocess_describe_main.cpp +0 -1
- mlpack/include/mlpack/methods/preprocess/preprocess_imputer_main.cpp +50 -129
- mlpack/include/mlpack/methods/preprocess/preprocess_one_hot_encoding_main.cpp +6 -6
- mlpack/include/mlpack/methods/preprocess/preprocess_scale_main.cpp +2 -3
- mlpack/include/mlpack/methods/preprocess/preprocess_split_main.cpp +3 -4
- mlpack/include/mlpack/methods/preprocess/scaling_model.hpp +6 -8
- mlpack/include/mlpack/methods/preprocess/scaling_model_impl.hpp +18 -20
- mlpack/include/mlpack/methods/random_forest/random_forest.hpp +5 -5
- mlpack/include/mlpack/methods/random_forest/random_forest_impl.hpp +9 -9
- mlpack/include/mlpack/methods/range_search/range_search_main.cpp +1 -1
- mlpack/include/mlpack/methods/rann/krann_main.cpp +1 -1
- mlpack/include/mlpack/methods/regularized_svd/regularized_svd_function_impl.hpp +1 -1
- mlpack/include/mlpack/methods/reinforcement_learning/async_learning_impl.hpp +8 -8
- mlpack/include/mlpack/methods/reinforcement_learning/ddpg_impl.hpp +16 -16
- mlpack/include/mlpack/methods/reinforcement_learning/environment/acrobot.hpp +4 -4
- mlpack/include/mlpack/methods/reinforcement_learning/environment/cart_pole.hpp +3 -3
- mlpack/include/mlpack/methods/reinforcement_learning/environment/cont_double_pole_cart.hpp +6 -5
- mlpack/include/mlpack/methods/reinforcement_learning/environment/pendulum.hpp +6 -5
- mlpack/include/mlpack/methods/reinforcement_learning/policy/aggregated_policy.hpp +2 -2
- mlpack/include/mlpack/methods/reinforcement_learning/q_learning_impl.hpp +10 -10
- mlpack/include/mlpack/methods/reinforcement_learning/q_networks/categorical_dqn.hpp +21 -17
- mlpack/include/mlpack/methods/reinforcement_learning/q_networks/dueling_dqn.hpp +69 -77
- mlpack/include/mlpack/methods/reinforcement_learning/q_networks/simple_dqn.hpp +9 -9
- mlpack/include/mlpack/methods/reinforcement_learning/sac_impl.hpp +14 -14
- mlpack/include/mlpack/methods/reinforcement_learning/td3_impl.hpp +14 -14
- mlpack/include/mlpack/methods/softmax_regression/softmax_regression_function_impl.hpp +1 -1
- mlpack/include/mlpack/methods/svdplusplus/svdplusplus_function_impl.hpp +1 -1
- mlpack/include/mlpack/namespace_compat.hpp +1 -0
- mlpack/include/mlpack/prereqs.hpp +1 -0
- mlpack/kde.cp39-win_amd64.pyd +0 -0
- mlpack/kernel_pca.cp39-win_amd64.pyd +0 -0
- mlpack/kfn.cp39-win_amd64.pyd +0 -0
- mlpack/kmeans.cp39-win_amd64.pyd +0 -0
- mlpack/knn.cp39-win_amd64.pyd +0 -0
- mlpack/krann.cp39-win_amd64.pyd +0 -0
- mlpack/lars.cp39-win_amd64.pyd +0 -0
- mlpack/linear_regression_predict.cp39-win_amd64.pyd +0 -0
- mlpack/linear_regression_train.cp39-win_amd64.pyd +0 -0
- mlpack/linear_svm.cp39-win_amd64.pyd +0 -0
- mlpack/lmnn.cp39-win_amd64.pyd +0 -0
- mlpack/local_coordinate_coding.cp39-win_amd64.pyd +0 -0
- mlpack/logistic_regression.cp39-win_amd64.pyd +0 -0
- mlpack/lsh.cp39-win_amd64.pyd +0 -0
- mlpack/mean_shift.cp39-win_amd64.pyd +0 -0
- mlpack/nbc.cp39-win_amd64.pyd +0 -0
- mlpack/nca.cp39-win_amd64.pyd +0 -0
- mlpack/nmf.cp39-win_amd64.pyd +0 -0
- mlpack/pca.cp39-win_amd64.pyd +0 -0
- mlpack/perceptron.cp39-win_amd64.pyd +0 -0
- mlpack/preprocess_binarize.cp39-win_amd64.pyd +0 -0
- mlpack/preprocess_describe.cp39-win_amd64.pyd +0 -0
- mlpack/preprocess_one_hot_encoding.cp39-win_amd64.pyd +0 -0
- mlpack/preprocess_scale.cp39-win_amd64.pyd +0 -0
- mlpack/preprocess_split.cp39-win_amd64.pyd +0 -0
- mlpack/radical.cp39-win_amd64.pyd +0 -0
- mlpack/random_forest.cp39-win_amd64.pyd +0 -0
- mlpack/softmax_regression.cp39-win_amd64.pyd +0 -0
- mlpack/sparse_coding.cp39-win_amd64.pyd +0 -0
- mlpack-4.7.0.dist-info/DELVEWHEEL +2 -0
- {mlpack-4.6.2.dist-info → mlpack-4.7.0.dist-info}/METADATA +2 -2
- {mlpack-4.6.2.dist-info → mlpack-4.7.0.dist-info}/RECORD +397 -378
- {mlpack-4.6.2.dist-info → mlpack-4.7.0.dist-info}/WHEEL +1 -1
- mlpack.libs/.load-order-mlpack-4.7.0 +2 -0
- mlpack/include/mlpack/core/data/format.hpp +0 -31
- mlpack/include/mlpack/core/data/image_info.hpp +0 -102
- mlpack/include/mlpack/core/data/image_info_impl.hpp +0 -84
- mlpack/include/mlpack/core/data/load_image_impl.hpp +0 -171
- mlpack/include/mlpack/core/data/load_model_impl.hpp +0 -115
- mlpack/include/mlpack/core/data/load_vec_impl.hpp +0 -154
- mlpack/include/mlpack/core/data/map_policies/missing_policy.hpp +0 -148
- mlpack/include/mlpack/core/data/save_image_impl.hpp +0 -170
- mlpack/include/mlpack/core/data/types.hpp +0 -61
- mlpack/include/mlpack/core/data/types_impl.hpp +0 -83
- mlpack/include/mlpack/core/data/utilities.hpp +0 -158
- mlpack/include/mlpack/core/util/gitversion.hpp +0 -1
- mlpack/include/mlpack/methods/ann/convolution_rules/fft_convolution.hpp +0 -213
- mlpack/include/mlpack/methods/ann/convolution_rules/svd_convolution.hpp +0 -201
- mlpack/include/mlpack/methods/ann/layer/not_adapted/gru.hpp +0 -226
- mlpack/include/mlpack/methods/ann/layer/not_adapted/gru_impl.hpp +0 -367
- mlpack/include/mlpack/methods/ann/layer/not_adapted/lookup.hpp +0 -139
- mlpack/include/mlpack/methods/ann/layer/not_adapted/lookup_impl.hpp +0 -98
- mlpack-4.6.2.dist-info/DELVEWHEEL +0 -2
- mlpack.libs/.load-order-mlpack-4.6.2 +0 -2
- {mlpack-4.6.2.dist-info → mlpack-4.7.0.dist-info}/top_level.txt +0 -0
- /mlpack.libs/{libopenblas-9e6d070f769e6580e8c55c0cf83b80a5.dll → libopenblas-c7f521b507686ddc25bee7538a80c374.dll} +0 -0
- /mlpack.libs/{msvcp140-50208655e42969b9a5ab8a4e0186bbb9.dll → msvcp140-a4c2229bdc2a2a630acdc095b4d86008.dll} +0 -0
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file combine_options.hpp
|
|
3
|
+
* @author Ryan Curtin
|
|
4
|
+
* @author Omar Shrit
|
|
5
|
+
*
|
|
6
|
+
* Definition of operator+() for DataOptions types.
|
|
7
|
+
*
|
|
8
|
+
* mlpack is free software; you may redistribute it and/or modify it under the
|
|
9
|
+
* terms of the 3-clause BSD license. You should have received a copy of the
|
|
10
|
+
* 3-clause BSD license along with mlpack. If not, see
|
|
11
|
+
* http://www.opensource.org/licenses/BSD-3-Clause for more information.
|
|
12
|
+
*/
|
|
13
|
+
#ifndef MLPACK_CORE_DATA_COMBINE_OPTIONS_HPP
|
|
14
|
+
#define MLPACK_CORE_DATA_COMBINE_OPTIONS_HPP
|
|
15
|
+
|
|
16
|
+
#include <mlpack/prereqs.hpp>
|
|
17
|
+
|
|
18
|
+
#include "data_options.hpp"
|
|
19
|
+
#include "matrix_options.hpp"
|
|
20
|
+
#include "text_options.hpp"
|
|
21
|
+
|
|
22
|
+
namespace mlpack {
|
|
23
|
+
|
|
24
|
+
// This template metaprogram encodes what the result of combining two different
|
|
25
|
+
// DataOptions types are. For now it exhaustively considers every possibility,
|
|
26
|
+
// but, in the future, perhaps it will be possible to come up with something
|
|
27
|
+
// that scales a little better.
|
|
28
|
+
|
|
29
|
+
template<typename DataOptionsType1, typename DataOptionsType2>
|
|
30
|
+
struct GetCombinedDataOptionsType
|
|
31
|
+
{
|
|
32
|
+
typedef void result; // unknown result
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
template<typename T>
|
|
36
|
+
struct MostDerivedType
|
|
37
|
+
{
|
|
38
|
+
typedef void result;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
template<typename Derived>
|
|
42
|
+
struct MostDerivedType<DataOptionsBase<Derived>>
|
|
43
|
+
{
|
|
44
|
+
typedef Derived result;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
template<>
|
|
48
|
+
struct MostDerivedType<DataOptionsBase<PlainDataOptions>>
|
|
49
|
+
{
|
|
50
|
+
typedef DataOptions result;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
template<>
|
|
54
|
+
struct MostDerivedType<DataOptionsBase<MatrixOptionsBase<PlainMatrixOptions>>>
|
|
55
|
+
{
|
|
56
|
+
typedef MatrixOptions result;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
template<>
|
|
60
|
+
struct MostDerivedType<DataOptionsBase<MatrixOptionsBase<TextOptions>>>
|
|
61
|
+
{
|
|
62
|
+
typedef TextOptions result;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
// When both types are the same, we return that type.
|
|
66
|
+
template<typename Derived>
|
|
67
|
+
struct GetCombinedDataOptionsType<DataOptionsBase<Derived>,
|
|
68
|
+
DataOptionsBase<Derived>>
|
|
69
|
+
{
|
|
70
|
+
typedef typename MostDerivedType<DataOptionsBase<Derived>>::result result;
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
// When both types are different, the result is hardcoded.
|
|
74
|
+
template<>
|
|
75
|
+
struct GetCombinedDataOptionsType<DataOptionsBase<PlainDataOptions>,
|
|
76
|
+
DataOptionsBase<MatrixOptionsBase<PlainMatrixOptions>>>
|
|
77
|
+
{
|
|
78
|
+
typedef MatrixOptions result;
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
template<>
|
|
82
|
+
struct GetCombinedDataOptionsType<DataOptionsBase<
|
|
83
|
+
MatrixOptionsBase<PlainMatrixOptions>>,
|
|
84
|
+
DataOptionsBase<PlainDataOptions>>
|
|
85
|
+
{
|
|
86
|
+
typedef MatrixOptions result;
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
template<>
|
|
90
|
+
struct GetCombinedDataOptionsType<DataOptionsBase<
|
|
91
|
+
MatrixOptionsBase<TextOptions>>, DataOptionsBase<PlainDataOptions>>
|
|
92
|
+
{
|
|
93
|
+
typedef TextOptions result;
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
template<>
|
|
97
|
+
struct GetCombinedDataOptionsType<DataOptionsBase<PlainDataOptions>,
|
|
98
|
+
DataOptionsBase<MatrixOptionsBase<TextOptions>>>
|
|
99
|
+
{
|
|
100
|
+
typedef TextOptions result;
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
template<>
|
|
104
|
+
struct GetCombinedDataOptionsType<
|
|
105
|
+
DataOptionsBase<MatrixOptionsBase<PlainMatrixOptions>>,
|
|
106
|
+
DataOptionsBase<MatrixOptionsBase<TextOptions>>>
|
|
107
|
+
{
|
|
108
|
+
typedef TextOptions result;
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
template<>
|
|
112
|
+
struct GetCombinedDataOptionsType<
|
|
113
|
+
DataOptionsBase<MatrixOptionsBase<TextOptions>>,
|
|
114
|
+
DataOptionsBase<MatrixOptionsBase<PlainMatrixOptions>>>
|
|
115
|
+
{
|
|
116
|
+
typedef TextOptions result;
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
// Using the template metaprogram above, return a combined DataOptions.
|
|
120
|
+
|
|
121
|
+
template<typename Derived1, typename Derived2>
|
|
122
|
+
typename GetCombinedDataOptionsType<DataOptionsBase<Derived1>,
|
|
123
|
+
DataOptionsBase<Derived2>>::result
|
|
124
|
+
operator+(const DataOptionsBase<Derived1>& a,
|
|
125
|
+
const DataOptionsBase<Derived2>& b)
|
|
126
|
+
{
|
|
127
|
+
using ReturnType = typename GetCombinedDataOptionsType<
|
|
128
|
+
DataOptionsBase<Derived1>, DataOptionsBase<Derived2>>::result;
|
|
129
|
+
|
|
130
|
+
if (std::is_same_v<Derived1, Derived2>)
|
|
131
|
+
{
|
|
132
|
+
// This is the easy case! They are the same.
|
|
133
|
+
ReturnType output(a);
|
|
134
|
+
output += b;
|
|
135
|
+
return output;
|
|
136
|
+
}
|
|
137
|
+
else
|
|
138
|
+
{
|
|
139
|
+
// Here's the hard part, where the types are different.
|
|
140
|
+
// In this case, we can keep only the options from both sides that will be
|
|
141
|
+
// used in the result. If members of a or b can't be represented in
|
|
142
|
+
// ReturnType, then a warning will be printed.
|
|
143
|
+
ReturnType convertedA(a);
|
|
144
|
+
ReturnType convertedB(b);
|
|
145
|
+
return convertedA + convertedB;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
} // namespace mlpack
|
|
150
|
+
|
|
151
|
+
#endif
|
|
@@ -16,7 +16,6 @@
|
|
|
16
16
|
#include <mlpack/prereqs.hpp>
|
|
17
17
|
|
|
18
18
|
namespace mlpack {
|
|
19
|
-
namespace data {
|
|
20
19
|
|
|
21
20
|
/**
|
|
22
21
|
* A confusion matrix is a summary of prediction results on a classification
|
|
@@ -56,7 +55,6 @@ void ConfusionMatrix(const arma::Row<size_t> predictors,
|
|
|
56
55
|
arma::Mat<eT>& output,
|
|
57
56
|
const size_t numClasses);
|
|
58
57
|
|
|
59
|
-
} // namespace data
|
|
60
58
|
} // namespace mlpack
|
|
61
59
|
|
|
62
60
|
// Include implementation.
|
|
@@ -17,7 +17,6 @@
|
|
|
17
17
|
#include "confusion_matrix.hpp"
|
|
18
18
|
|
|
19
19
|
namespace mlpack {
|
|
20
|
-
namespace data {
|
|
21
20
|
|
|
22
21
|
/**
|
|
23
22
|
* A confusion matrix is a summary of prediction results on a classification
|
|
@@ -60,7 +59,6 @@ void ConfusionMatrix(const arma::Row<size_t> predictors,
|
|
|
60
59
|
}
|
|
61
60
|
}
|
|
62
61
|
|
|
63
|
-
} // namespace data
|
|
64
62
|
} // namespace mlpack
|
|
65
63
|
|
|
66
64
|
#endif
|
|
@@ -13,7 +13,6 @@
|
|
|
13
13
|
#define MLPACK_CORE_DATA_DATA_HPP
|
|
14
14
|
|
|
15
15
|
#include "extension.hpp"
|
|
16
|
-
#include "format.hpp"
|
|
17
16
|
#include "has_serialize.hpp"
|
|
18
17
|
|
|
19
18
|
#include "load.hpp"
|
|
@@ -31,8 +30,11 @@
|
|
|
31
30
|
#include "dataset_mapper.hpp"
|
|
32
31
|
#include "data_options.hpp"
|
|
33
32
|
#include "detect_file_type.hpp"
|
|
34
|
-
#include "
|
|
33
|
+
#include "image_layout.hpp"
|
|
34
|
+
#include "image_options.hpp"
|
|
35
35
|
#include "image_resize_crop.hpp"
|
|
36
|
+
#include "image_letterbox.hpp"
|
|
37
|
+
#include "image_bounding_box.hpp"
|
|
36
38
|
#include "imputer.hpp"
|
|
37
39
|
#include "is_naninf.hpp"
|
|
38
40
|
#include "matrix_options.hpp"
|
|
@@ -41,7 +43,7 @@
|
|
|
41
43
|
#include "split_data.hpp"
|
|
42
44
|
#include "string_algorithms.hpp"
|
|
43
45
|
#include "text_options.hpp"
|
|
44
|
-
|
|
45
|
-
#include "
|
|
46
|
+
|
|
47
|
+
#include "combine_options.hpp"
|
|
46
48
|
|
|
47
49
|
#endif
|
|
@@ -16,14 +16,54 @@
|
|
|
16
16
|
|
|
17
17
|
#include <mlpack/prereqs.hpp>
|
|
18
18
|
|
|
19
|
-
#include "types.hpp"
|
|
20
19
|
#include "dataset_mapper.hpp"
|
|
21
20
|
#include "map_policies/map_policies.hpp"
|
|
22
|
-
#include "format.hpp"
|
|
23
|
-
#include "image_info.hpp"
|
|
24
21
|
|
|
25
22
|
namespace mlpack {
|
|
26
|
-
|
|
23
|
+
|
|
24
|
+
enum struct FileType
|
|
25
|
+
{
|
|
26
|
+
FileTypeUnknown,
|
|
27
|
+
AutoDetect, // attempt to automatically detect the file type
|
|
28
|
+
RawASCII, // raw text (ASCII), without a header
|
|
29
|
+
ArmaASCII, // Armadillo text format, with a header specifying matrix type and
|
|
30
|
+
// size
|
|
31
|
+
CSVASCII, // comma separated values (CSV), without a header
|
|
32
|
+
RawBinary, // raw binary format (machine dependent), without a header
|
|
33
|
+
ArmaBinary, // Armadillo binary format (machine dependent), with a header
|
|
34
|
+
// specifying matrix type and size
|
|
35
|
+
PGMBinary, // Portable Grey Map (greyscale image)
|
|
36
|
+
PPMBinary, // Portable Pixel Map (colour image), used by the field and cube
|
|
37
|
+
// classes
|
|
38
|
+
HDF5Binary, // HDF5: open binary format, not specific to Armadillo, which can
|
|
39
|
+
// store arbitrary data
|
|
40
|
+
CoordASCII, // simple co-ordinate format for sparse matrices (indices start at
|
|
41
|
+
// zero)
|
|
42
|
+
ARFFASCII, // ARFF data format, with a header specifying information about
|
|
43
|
+
// categories of the data.
|
|
44
|
+
JSON, // Serialize data using Cereal library into JSON format.
|
|
45
|
+
XML, // Serialize data using Cereal library into xml format.
|
|
46
|
+
BIN, // Serialize data using Cereal library into binary format.
|
|
47
|
+
ImageType, // Any image type, STB will try to detect the type.
|
|
48
|
+
PNG, // Portable Network Graphics image type.
|
|
49
|
+
JPG, // Joint Photographic Experts Group image type.
|
|
50
|
+
TGA, // Truevision TGA image type.
|
|
51
|
+
BMP, // Bitmap image type.
|
|
52
|
+
PSD, // PhotoShop image type.
|
|
53
|
+
GIF, // Graphics Interchange Format image type.
|
|
54
|
+
PIC, // PICtor image format.
|
|
55
|
+
PNM // Portable Anymap format.
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
// This should be removed in mlpack 5.0.0. It is only here for backward
|
|
59
|
+
// compatibility.
|
|
60
|
+
enum format
|
|
61
|
+
{
|
|
62
|
+
autodetect,
|
|
63
|
+
json,
|
|
64
|
+
xml,
|
|
65
|
+
binary
|
|
66
|
+
};
|
|
27
67
|
|
|
28
68
|
/**
|
|
29
69
|
* All possible DataOptions grouped under one class.
|
|
@@ -34,15 +74,15 @@ namespace data {
|
|
|
34
74
|
template<typename Derived>
|
|
35
75
|
class DataOptionsBase
|
|
36
76
|
{
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
77
|
+
protected:
|
|
78
|
+
// Users should not construct a DataOptionsBase directly.
|
|
79
|
+
DataOptionsBase(const std::optional<bool> fatal = std::nullopt,
|
|
80
|
+
const std::optional<FileType> format = std::nullopt) :
|
|
40
81
|
fatal(fatal),
|
|
41
82
|
format(format)
|
|
42
|
-
{
|
|
43
|
-
// Do nothing.
|
|
44
|
-
}
|
|
83
|
+
{ }
|
|
45
84
|
|
|
85
|
+
public:
|
|
46
86
|
template<typename Derived2>
|
|
47
87
|
explicit DataOptionsBase(const DataOptionsBase<Derived2>& opts)
|
|
48
88
|
{
|
|
@@ -77,7 +117,7 @@ class DataOptionsBase
|
|
|
77
117
|
template<typename Derived2>
|
|
78
118
|
DataOptionsBase& operator=(DataOptionsBase<Derived2>&& other)
|
|
79
119
|
{
|
|
80
|
-
if ((void*) &other
|
|
120
|
+
if ((void*) &other == (void*) this)
|
|
81
121
|
return *this;
|
|
82
122
|
|
|
83
123
|
// Print warnings for any members that cannot be converted.
|
|
@@ -88,6 +128,63 @@ class DataOptionsBase
|
|
|
88
128
|
return *this;
|
|
89
129
|
}
|
|
90
130
|
|
|
131
|
+
// Augment with the options of the other `DataOptionsBase`.
|
|
132
|
+
template<typename Derived2>
|
|
133
|
+
DataOptionsBase& operator+=(const DataOptionsBase<Derived2>& other)
|
|
134
|
+
{
|
|
135
|
+
Combine(other);
|
|
136
|
+
return *this;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
// Augment with the options of the other `DataOptionsBase`.
|
|
140
|
+
template<typename Derived2>
|
|
141
|
+
void Combine(const DataOptionsBase<Derived2>& other)
|
|
142
|
+
{
|
|
143
|
+
// Combine the fatal option.
|
|
144
|
+
fatal = CombineBooleanOption(fatal, other.fatal, "Fatal()");
|
|
145
|
+
|
|
146
|
+
// Combine the format option.
|
|
147
|
+
if (format.has_value() && other.format.has_value())
|
|
148
|
+
{
|
|
149
|
+
// There are two cases where we can accept the other's format---when we
|
|
150
|
+
// are unknown or autodetect.
|
|
151
|
+
if (format == FileType::FileTypeUnknown)
|
|
152
|
+
{
|
|
153
|
+
// Here we always take the other format.
|
|
154
|
+
format = other.format;
|
|
155
|
+
}
|
|
156
|
+
else if (format == FileType::AutoDetect && \
|
|
157
|
+
other.format != FileType::FileTypeUnknown)
|
|
158
|
+
{
|
|
159
|
+
format = other.format;
|
|
160
|
+
}
|
|
161
|
+
else if (other.format != FileType::FileTypeUnknown && \
|
|
162
|
+
other.format != FileType::AutoDetect &&
|
|
163
|
+
format != other.format)
|
|
164
|
+
{
|
|
165
|
+
// In any other case, we won't overwrite one specified format with
|
|
166
|
+
// another.
|
|
167
|
+
throw std::invalid_argument("DataOptions::operator+(): cannot combine "
|
|
168
|
+
"options with formats '" + FileTypeToString() + "' and '" +
|
|
169
|
+
other.FileTypeToString() + "'!");
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
else if (!format.has_value() && other.format.has_value())
|
|
173
|
+
{
|
|
174
|
+
// Always take the format of the other if it's unspecified.
|
|
175
|
+
format = other.format;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
// If the derived type is the same, we can take any options from it.
|
|
179
|
+
if constexpr (std::is_same_v<Derived, Derived2>)
|
|
180
|
+
{
|
|
181
|
+
static_cast<Derived&>(*this).Combine(static_cast<const Derived2&>(other));
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
// If Derived is not the same as Derived2, we will have printed warnings in
|
|
185
|
+
// the standalone operator+().
|
|
186
|
+
}
|
|
187
|
+
|
|
91
188
|
template<typename Derived2>
|
|
92
189
|
void CopyOptions(const DataOptionsBase<Derived2>& other)
|
|
93
190
|
{
|
|
@@ -127,6 +224,64 @@ class DataOptionsBase
|
|
|
127
224
|
// Modify the file format to load.
|
|
128
225
|
FileType& Format() { return ModifyMember(format, defaultFormat); }
|
|
129
226
|
|
|
227
|
+
/**
|
|
228
|
+
* Given a file type, return Armadillo type corresponding to that file type.
|
|
229
|
+
*/
|
|
230
|
+
inline arma::file_type ArmaFormat() const
|
|
231
|
+
{
|
|
232
|
+
FileType f = format.has_value() ? *format : defaultFormat;
|
|
233
|
+
switch (f)
|
|
234
|
+
{
|
|
235
|
+
case FileType::FileTypeUnknown:
|
|
236
|
+
return arma::file_type_unknown;
|
|
237
|
+
break;
|
|
238
|
+
|
|
239
|
+
case FileType::AutoDetect:
|
|
240
|
+
return arma::auto_detect;
|
|
241
|
+
break;
|
|
242
|
+
|
|
243
|
+
case FileType::RawASCII:
|
|
244
|
+
return arma::raw_ascii;
|
|
245
|
+
break;
|
|
246
|
+
|
|
247
|
+
case FileType::ArmaASCII:
|
|
248
|
+
return arma::arma_ascii;
|
|
249
|
+
break;
|
|
250
|
+
|
|
251
|
+
case FileType::CSVASCII:
|
|
252
|
+
return arma::csv_ascii;
|
|
253
|
+
break;
|
|
254
|
+
|
|
255
|
+
case FileType::RawBinary:
|
|
256
|
+
return arma::raw_binary;
|
|
257
|
+
break;
|
|
258
|
+
|
|
259
|
+
case FileType::ArmaBinary:
|
|
260
|
+
return arma::arma_binary;
|
|
261
|
+
break;
|
|
262
|
+
|
|
263
|
+
case FileType::PGMBinary:
|
|
264
|
+
return arma::pgm_binary;
|
|
265
|
+
break;
|
|
266
|
+
|
|
267
|
+
case FileType::PPMBinary:
|
|
268
|
+
return arma::ppm_binary;
|
|
269
|
+
break;
|
|
270
|
+
|
|
271
|
+
case FileType::HDF5Binary:
|
|
272
|
+
return arma::hdf5_binary;
|
|
273
|
+
break;
|
|
274
|
+
|
|
275
|
+
case FileType::CoordASCII:
|
|
276
|
+
return arma::coord_ascii;
|
|
277
|
+
break;
|
|
278
|
+
|
|
279
|
+
default:
|
|
280
|
+
return arma::file_type_unknown;
|
|
281
|
+
break;
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
|
|
130
285
|
/**
|
|
131
286
|
* Given a file type, return a logical name corresponding to that file type.
|
|
132
287
|
*/
|
|
@@ -145,8 +300,21 @@ class DataOptionsBase
|
|
|
145
300
|
case FileType::HDF5Binary: return "HDF5 data";
|
|
146
301
|
case FileType::CoordASCII:
|
|
147
302
|
return "ASCII formatted sparse coordinate data";
|
|
303
|
+
case FileType::ARFFASCII: return "ARFF data";
|
|
304
|
+
case FileType::XML: return "XML model";
|
|
305
|
+
case FileType::BIN: return "binary model";
|
|
306
|
+
case FileType::JSON: return "JSON model";
|
|
148
307
|
case FileType::AutoDetect: return "Detect automatically data type";
|
|
149
308
|
case FileType::FileTypeUnknown: return "Unknown data type";
|
|
309
|
+
case FileType::ImageType: return "Any Image type";
|
|
310
|
+
case FileType::PNG: return "Portable Network Graphics image data";
|
|
311
|
+
case FileType::JPG: return "JPEG image data";
|
|
312
|
+
case FileType::TGA: return "Truevision TGA image data";
|
|
313
|
+
case FileType::BMP: return "Bitmap image data";
|
|
314
|
+
case FileType::PSD: return "PhotoShop image data";
|
|
315
|
+
case FileType::GIF: return "GIF image data";
|
|
316
|
+
case FileType::PIC: return "PICtor image data";
|
|
317
|
+
case FileType::PNM: return "Portable Anymap data";
|
|
150
318
|
default: return "";
|
|
151
319
|
}
|
|
152
320
|
}
|
|
@@ -187,33 +355,188 @@ class DataOptionsBase
|
|
|
187
355
|
}
|
|
188
356
|
}
|
|
189
357
|
|
|
358
|
+
std::optional<bool> CombineBooleanOption(const std::optional<bool>& a,
|
|
359
|
+
const std::optional<bool>& b,
|
|
360
|
+
const std::string name)
|
|
361
|
+
{
|
|
362
|
+
if (a.has_value() && b.has_value() && ((*a) != (*b)))
|
|
363
|
+
{
|
|
364
|
+
// If both are set, but not the same, then throw an exception---this is
|
|
365
|
+
// invalid.
|
|
366
|
+
throw std::invalid_argument("DataOptions::operator+(): cannot combine "
|
|
367
|
+
"options where " + name + " is set to true in one object and false "
|
|
368
|
+
"in the other!");
|
|
369
|
+
}
|
|
370
|
+
else if (!a.has_value() && b.has_value())
|
|
371
|
+
{
|
|
372
|
+
// If only b is set, take b.
|
|
373
|
+
return b;
|
|
374
|
+
}
|
|
375
|
+
else
|
|
376
|
+
{
|
|
377
|
+
// Otherwise, take a (whether or not it is set).
|
|
378
|
+
return a;
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
|
|
190
382
|
private:
|
|
191
383
|
std::optional<bool> fatal;
|
|
192
384
|
std::optional<FileType> format;
|
|
193
385
|
|
|
194
386
|
constexpr static const bool defaultFatal = false;
|
|
195
387
|
constexpr static const FileType defaultFormat = FileType::AutoDetect;
|
|
196
|
-
|
|
197
388
|
// For access to internal optional members.
|
|
198
389
|
template<typename Derived2>
|
|
199
390
|
friend class DataOptionsBase;
|
|
200
391
|
};
|
|
201
392
|
|
|
202
|
-
// This
|
|
203
|
-
//
|
|
204
|
-
|
|
205
|
-
class EmptyOptions : public DataOptionsBase<EmptyOptions>
|
|
393
|
+
// This is the class that should be used if a DataOptions with no extra options
|
|
394
|
+
// is meant to be constructed.
|
|
395
|
+
class PlainDataOptions : public DataOptionsBase<PlainDataOptions>
|
|
206
396
|
{
|
|
207
397
|
public:
|
|
398
|
+
// Allow access to all DataOptionsBase non-protected constructors and
|
|
399
|
+
// operators, but with the PlainDataOptions type name.
|
|
400
|
+
using DataOptionsBase::DataOptionsBase;
|
|
401
|
+
using DataOptionsBase::operator=;
|
|
402
|
+
|
|
403
|
+
// However, C++ does not allow inheriting copy and move constructors or
|
|
404
|
+
// operators, and any inherited protected constructors will still be
|
|
405
|
+
// protected, so forward those manually.
|
|
406
|
+
PlainDataOptions(const std::optional<bool> fatal = std::nullopt,
|
|
407
|
+
const std::optional<FileType> format = std::nullopt) :
|
|
408
|
+
DataOptionsBase(fatal, format) { }
|
|
409
|
+
PlainDataOptions(const DataOptionsBase<PlainDataOptions>& other) :
|
|
410
|
+
DataOptionsBase(other) { }
|
|
411
|
+
PlainDataOptions(DataOptionsBase<PlainDataOptions>&& other) :
|
|
412
|
+
DataOptionsBase(std::move(other)) { }
|
|
413
|
+
|
|
414
|
+
PlainDataOptions& operator=(const DataOptionsBase<PlainDataOptions>& other)
|
|
415
|
+
{
|
|
416
|
+
return static_cast<PlainDataOptions&>(DataOptionsBase::operator=(other));
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
PlainDataOptions& operator=(DataOptionsBase<PlainDataOptions>&& other)
|
|
420
|
+
{
|
|
421
|
+
return static_cast<PlainDataOptions&>(
|
|
422
|
+
DataOptionsBase::operator=(std::move(other)));
|
|
423
|
+
}
|
|
424
|
+
|
|
208
425
|
void WarnBaseConversion(const char* /* dataDescription */) const { }
|
|
209
426
|
static const char* DataDescription() { return "general data"; }
|
|
210
427
|
void Reset() { }
|
|
428
|
+
void Combine(const PlainDataOptions&) { }
|
|
429
|
+
};
|
|
430
|
+
|
|
431
|
+
using DataOptions = PlainDataOptions;
|
|
432
|
+
|
|
433
|
+
// Boolean options
|
|
434
|
+
static const DataOptions Fatal = DataOptions(true);
|
|
435
|
+
static const DataOptions NoFatal = DataOptions(false);
|
|
436
|
+
|
|
437
|
+
//! File options
|
|
438
|
+
static const DataOptions CSV = DataOptions(std::nullopt, FileType::CSVASCII);
|
|
439
|
+
static const DataOptions PGM = DataOptions(std::nullopt, FileType::PGMBinary);
|
|
440
|
+
static const DataOptions PPM = DataOptions(std::nullopt, FileType::PPMBinary);
|
|
441
|
+
static const DataOptions HDF5 = DataOptions(std::nullopt,
|
|
442
|
+
FileType::HDF5Binary);
|
|
443
|
+
static const DataOptions ArmaAscii = DataOptions(std::nullopt,
|
|
444
|
+
FileType::ArmaASCII);
|
|
445
|
+
static const DataOptions ArmaBin = DataOptions(std::nullopt,
|
|
446
|
+
FileType::ArmaBinary);
|
|
447
|
+
static const DataOptions RawAscii = DataOptions(std::nullopt,
|
|
448
|
+
FileType::RawASCII);
|
|
449
|
+
static const DataOptions BinAscii = DataOptions(std::nullopt,
|
|
450
|
+
FileType::RawBinary);
|
|
451
|
+
static const DataOptions CoordAscii = DataOptions(std::nullopt,
|
|
452
|
+
FileType::CoordASCII);
|
|
453
|
+
static const DataOptions ARFF = DataOptions(std::nullopt,
|
|
454
|
+
FileType::ARFFASCII);
|
|
455
|
+
static const DataOptions AutoDetect = DataOptions(std::nullopt,
|
|
456
|
+
FileType::AutoDetect);
|
|
457
|
+
static const DataOptions JSON = DataOptions(std::nullopt, FileType::JSON);
|
|
458
|
+
static const DataOptions XML = DataOptions(std::nullopt, FileType::XML);
|
|
459
|
+
static const DataOptions BIN = DataOptions(std::nullopt, FileType::BIN);
|
|
460
|
+
static const DataOptions PNG = DataOptions(std::nullopt, FileType::PNG);
|
|
461
|
+
static const DataOptions JPG = DataOptions(std::nullopt, FileType::JPG);
|
|
462
|
+
static const DataOptions TGA = DataOptions(std::nullopt, FileType::TGA);
|
|
463
|
+
static const DataOptions BMP = DataOptions(std::nullopt, FileType::BMP);
|
|
464
|
+
static const DataOptions PSD = DataOptions(std::nullopt, FileType::PSD);
|
|
465
|
+
static const DataOptions GIF = DataOptions(std::nullopt, FileType::GIF);
|
|
466
|
+
static const DataOptions PIC = DataOptions(std::nullopt, FileType::PIC);
|
|
467
|
+
static const DataOptions PNM = DataOptions(std::nullopt, FileType::PNM);
|
|
468
|
+
static const DataOptions Image = DataOptions(std::nullopt,
|
|
469
|
+
FileType::ImageType);
|
|
470
|
+
|
|
471
|
+
// Utility struct to detect when something is a `DataOptions`.
|
|
472
|
+
|
|
473
|
+
template<typename T>
|
|
474
|
+
struct IsDataOptions
|
|
475
|
+
{
|
|
476
|
+
constexpr static bool value = false;
|
|
477
|
+
};
|
|
478
|
+
|
|
479
|
+
template<typename T>
|
|
480
|
+
struct IsDataOptions<DataOptionsBase<T>>
|
|
481
|
+
{
|
|
482
|
+
constexpr static bool value = true;
|
|
211
483
|
};
|
|
212
484
|
|
|
213
|
-
|
|
485
|
+
template<>
|
|
486
|
+
struct IsDataOptions<DataOptions>
|
|
487
|
+
{
|
|
488
|
+
constexpr static bool value = true;
|
|
489
|
+
};
|
|
214
490
|
|
|
491
|
+
template<typename Derived>
|
|
492
|
+
bool HandleError(const std::stringstream& oss,
|
|
493
|
+
const DataOptionsBase<Derived>& opts)
|
|
494
|
+
{
|
|
495
|
+
bool success = true; // this should never be returned as true.
|
|
496
|
+
if (opts.Fatal())
|
|
497
|
+
{
|
|
498
|
+
Log::Fatal << oss.str() << std::endl;
|
|
499
|
+
}
|
|
500
|
+
else
|
|
501
|
+
{
|
|
502
|
+
Log::Warn << oss.str() << std::endl;
|
|
503
|
+
success = false;
|
|
504
|
+
}
|
|
505
|
+
return success;
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
template<typename Derived>
|
|
509
|
+
bool HandleError(const std::string& msg,
|
|
510
|
+
const DataOptionsBase<Derived>& opts)
|
|
511
|
+
{
|
|
512
|
+
std::stringstream oss;
|
|
513
|
+
oss << msg;
|
|
514
|
+
return HandleError(oss, opts);
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
// Required for backward compatibility.
|
|
518
|
+
inline bool HandleError(const std::stringstream& oss, bool fatal)
|
|
519
|
+
{
|
|
520
|
+
bool success = true; // this should never be returned as true.
|
|
521
|
+
if (fatal)
|
|
522
|
+
{
|
|
523
|
+
Log::Fatal << oss.str() << std::endl;
|
|
524
|
+
}
|
|
525
|
+
else
|
|
526
|
+
{
|
|
527
|
+
Log::Warn << oss.str() << std::endl;
|
|
528
|
+
success = false;
|
|
529
|
+
}
|
|
530
|
+
return success;
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
inline bool HandleError(const std::string& msg, bool fatal)
|
|
534
|
+
{
|
|
535
|
+
std::stringstream oss;
|
|
536
|
+
oss << msg;
|
|
537
|
+
return HandleError(oss, fatal);
|
|
538
|
+
}
|
|
215
539
|
|
|
216
|
-
} // namespace data
|
|
217
540
|
} // namespace mlpack
|
|
218
541
|
|
|
219
542
|
#endif
|
|
@@ -21,12 +21,11 @@
|
|
|
21
21
|
#include "map_policies/increment_policy.hpp"
|
|
22
22
|
|
|
23
23
|
namespace mlpack {
|
|
24
|
-
namespace data {
|
|
25
24
|
|
|
26
25
|
/**
|
|
27
26
|
* Auxiliary information for a dataset, including mappings to/from strings (or
|
|
28
27
|
* other types) and the datatype of each dimension. DatasetMapper objects are
|
|
29
|
-
* optionally produced by
|
|
28
|
+
* optionally produced by Load(), and store the type of each dimension
|
|
30
29
|
* (Datatype::numeric or Datatype::categorical) as well as mappings from strings
|
|
31
30
|
* to unsigned integers and vice versa.
|
|
32
31
|
*
|
|
@@ -142,7 +141,7 @@ class DatasetMapper
|
|
|
142
141
|
/**
|
|
143
142
|
* Get the dimensionality of the DatasetMapper object (that is, how many
|
|
144
143
|
* dimensions it has information for). If this object was created by a call
|
|
145
|
-
* to mlpack::
|
|
144
|
+
* to mlpack::Load(), then the dimensionality will be the same as the
|
|
146
145
|
* number of rows (dimensions) in the dataset.
|
|
147
146
|
*/
|
|
148
147
|
size_t Dimensionality() const;
|
|
@@ -193,9 +192,8 @@ class DatasetMapper
|
|
|
193
192
|
};
|
|
194
193
|
|
|
195
194
|
// Use typedef to provide backward compatibility
|
|
196
|
-
using DatasetInfo = DatasetMapper<
|
|
195
|
+
using DatasetInfo = DatasetMapper<IncrementPolicy>;
|
|
197
196
|
|
|
198
|
-
} // namespace data
|
|
199
197
|
} // namespace mlpack
|
|
200
198
|
|
|
201
199
|
#include "dataset_mapper_impl.hpp"
|
|
@@ -17,7 +17,6 @@
|
|
|
17
17
|
#include "dataset_mapper.hpp"
|
|
18
18
|
|
|
19
19
|
namespace mlpack {
|
|
20
|
-
namespace data {
|
|
21
20
|
|
|
22
21
|
// Default constructor.
|
|
23
22
|
template<typename PolicyType, typename InputType>
|
|
@@ -248,7 +247,6 @@ inline void DatasetMapper<PolicyType, InputType>::Policy(PolicyType&& policy)
|
|
|
248
247
|
this->policy = std::forward<PolicyType>(policy);
|
|
249
248
|
}
|
|
250
249
|
|
|
251
|
-
} // namespace data
|
|
252
250
|
} // namespace mlpack
|
|
253
251
|
|
|
254
252
|
#endif
|