utils.batch_gen_func module
RosenPy: An Open Source Python Framework for Complex-Valued Neural Networks. Copyright © A. A. Cruz, K. S. Mayer, D. S. Arantes.
License:
This file is part of RosenPy. RosenPy is an open source framework distributed under the terms of the GNU General Public License, as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. For additional information on license terms, please open the Readme.md file.
RosenPy is distributed in the hope that it will be useful to every user, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with RosenPy. If not, see <http://www.gnu.org/licenses/>.
- utils.batch_gen_func.batch_sequential(module, x, y, batch_size=1)[source]
Generates sequential batches of data for neural network training.
- Parameters:
xp (module) – CuPy or NumPy module for array handling.
x (array-like, shape (n_samples, n_inputs)) – Training vectors as real numbers, where n_samples is the number of samples and n_inputs is the number of input features.
y (array-like, shape (n_samples, n_outputs)) – Target values representing the desired outputs.
batch_size (int, optional) – Size of each batch. If batch_size equals 1, the algorithm will perform Stochastic Gradient Descent (SGD). Default is 1.
- Returns:
x_batches (array-like, shape (n_batches, batch_size, n_inputs)) – Batches of training inputs.
y_batches (array-like, shape (n_batches, batch_size, n_outputs)) – Batches of target outputs.
- utils.batch_gen_func.batch_shuffle(module, x, y, batch_size=1)[source]
Generates shuffled batches of data for neural network training.
- Parameters:
xp (module) – CuPy or NumPy module for array handling.
x (array-like, shape (n_samples, n_inputs)) – Training vectors as real numbers, where n_samples is the number of samples and n_inputs is the number of input features.
y (array-like, shape (n_samples, n_outputs)) – Target values representing the desired outputs.
batch_size (int, optional) – Size of each batch. If batch_size equals 1, the algorithm will perform Stochastic Gradient Descent (SGD). Default is 1.
- Returns:
x_batches (array-like, shape (n_batches, batch_size, n_inputs)) – Batches of shuffled training inputs.
y_batches (array-like, shape (n_batches, batch_size, n_outputs)) – Batches of shuffled target outputs.