Gaussian Receptive Field Generator.
This class extends the ReceptiveFieldGenerator class to generate Gaussian receptive fields.
Parameters:
-----------
input_size (tuple): The size of the input images (height, width, channels).
exclusion_distance (int, optional): The minimum distance from the image border to exclude when generating
receptive fields. Defaults to 3.
q_threshold (int, optional): The minimum area of the generated receptive fields. Defaults to 10.
num_classes (int, optional): Number of classes. Defaults to None.
sigma (float, optional): Standard deviation of the Gaussian distribution. Defaults to None.
Attributes:
-----------
sigma (float): Standard deviation of the Gaussian distribution.
Methods:
-----------
to_dict(): Convert the generator to a dictionary of attributes.
load(attributes): Load a generator instance from a dictionary of attributes.
_apply_rectangle_mask(image, top_left, bottom_right): Apply a Gaussian mask to an image.
Examples:
-----------
Initialization of Receptive Field Generator
>>> rf = ReceptiveFieldGaussianGenerator(input_size=(28, 28, 1))
Initialize an Extreme Learning Machine layer with receptive field (RF-ELM)
>>> elm = ELMLayer(number_neurons=num_neurons, activation='mish', receptive_field_generator=rf)
>>> model = ELMModel(elm)
Define a cross-validation strategy
>>> cv = RepeatedKFold(n_splits=n_splits, n_repeats=n_repeats)
Perform cross-validation to evaluate the model performance
>>> scores = cross_val_score(model, X, y, cv=cv, scoring='accuracy', error_score='raise')
Print the mean accuracy score obtained from cross-validation
>>> print(np.mean(scores))
Fit the ELM model to the entire dataset
>>> model.fit(X, y)