utils.init_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.init_func.glorot_normal(module, rows, cols, i=0)[source]
Initializes a complex matrix using the Glorot normal initialization method.
- Parameters:
module (module) – CuPy/Numpy module.
rows (int) – The number of rows in the matrix.
cols (int) – The number of columns in the matrix.
- Returns:
A complex matrix of size (rows, cols) initialized using the Glorot normal initialization method.
- Return type:
array-like
- utils.init_func.glorot_uniform(module, rows, cols, i=0)[source]
Initializes a complex matrix using the Glorot uniform initialization method.
- Parameters:
module (module) – CuPy/Numpy module.
rows (int) – The number of rows in the matrix.
cols (int) – The number of columns in the matrix.
- Returns:
A complex matrix of size (rows, cols) initialized using the Glorot uniform initialization method.
- Return type:
array-like
- utils.init_func.ones(module, rows, cols, i=0)[source]
Initializes a complex matrix with all elements set to one.
- Parameters:
module (module) – CuPy/Numpy module.
rows (int) – The number of rows in the matrix.
cols (int) – The number of columns in the matrix.
- Returns:
A complex matrix of size (rows, cols) with all elements set to one.
- Return type:
array-like
- utils.init_func.ones_real(module, rows, cols, i=0)[source]
Initializes a real matrix with all elements set to one.
- Parameters:
module (module) – CuPy/Numpy module.
rows (int) – The number of rows in the matrix.
cols (int) – The number of columns in the matrix.
- Returns:
A real matrix of size (rows, cols) with all elements set to one.
- Return type:
array-like
- utils.init_func.opt_conv_ptrbf_weights(module, rows, cols, i=0)[source]
Initializes complex convolutional weights with elements sampled from a uniform distribution and adjusted for optimization.
- Parameters:
module (module) – CuPy/Numpy module.
rows (int) – The number of rows in the matrix.
cols (int) – The number of columns in the matrix.
i (int, optional) – The number of neurons in input (default is 0).
- Returns:
A complex convolutional weight matrix of size (rows, cols) with elements sampled from a uniform distribution and adjusted for optimization.
- Return type:
array-like
- utils.init_func.opt_crbf_gamma(module, rows, cols, i=0)[source]
Initializes complex gamma weights for CRBF (Complex Radial Basis Function) with elements sampled from a uniform distribution.
- Parameters:
module (module) – CuPy/Numpy module.
rows (int) – The number of rows in the matrix.
cols (int) – The number of columns in the matrix.
i (int, optional) – The number of neurons in input (default is 0).
- Returns:
A complex gamma weight matrix of size (rows, cols) for CRBF with elements sampled from a uniform distribution.
- Return type:
array-like
- utils.init_func.opt_crbf_weights(module, rows, cols, i=0)[source]
Initializes complex weights for CRBF (Complex Radial Basis Function) with elements sampled from a uniform distribution and adjusted for optimization.
- Parameters:
module (module) – CuPy/Numpy module.
rows (int) – The number of rows in the matrix.
cols (int) – The number of columns in the matrix.
i (int, optional) – The number of neurons in input (default is 0).
- Returns:
A complex weight matrix of size (rows, cols) for CRBF with elements sampled from a uniform distribution and adjusted for optimization.
- Return type:
array-like
- utils.init_func.opt_ptrbf_gamma(module, rows, cols, i=0)[source]
Initializes complex gamma weights with elements sampled from a uniform distribution.
- Parameters:
module (module) – CuPy/Numpy module.
rows (int) – The number of rows in the matrix.
cols (int) – The number of columns in the matrix.
i (int, optional) – The number of neurons in input (default is 0).
- Returns:
A complex gamma weight matrix of size (rows, cols) with elements sampled from a uniform distribution.
- Return type:
array-like
- utils.init_func.opt_ptrbf_weights(module, rows, cols, i=0)[source]
Initializes complex weights with elements sampled from a uniform distribution and adjusted for optimization.
- Parameters:
module (module) – CuPy/Numpy module.
rows (int) – The number of rows in the matrix.
cols (int) – The number of columns in the matrix.
i (int, optional) – The number of neurons in input (default is 0).
- Returns:
A complex weight matrix of size (rows, cols) with elements sampled from a uniform distribution and adjusted for optimization.
- Return type:
array-like
- utils.init_func.random_normal(module, rows, cols, i=0)[source]
Initializes a complex matrix with elements sampled from a normal distribution.
- Parameters:
module (module) – CuPy/Numpy module.
rows (int) – The number of rows in the matrix.
cols (int) – The number of columns in the matrix.
- Returns:
A complex matrix of size (rows, cols) with elements sampled from a normal distribution.
- Return type:
array-like
- utils.init_func.random_uniform(module, rows, cols, i=0)[source]
Initializes a complex matrix with elements sampled from a uniform distribution.
- Parameters:
module (module) – CuPy/Numpy module.
rows (int) – The number of rows in the matrix.
cols (int) – The number of columns in the matrix.
- Returns:
A complex matrix of size (rows, cols) with elements sampled from a uniform distribution.
- Return type:
array-like
- utils.init_func.rbf_default(module, rows, cols, i=0)[source]
Initializes a complex matrix with elements generated from a random binary distribution.
- Parameters:
module (module) – CuPy/Numpy module.
rows (int) – The number of rows in the matrix.
cols (int) – The number of columns in the matrix.
- Returns:
A complex matrix of size (rows, cols) with elements generated from a random binary distribution.
- Return type:
array-like
- utils.init_func.ru_gamma_ptrbf(module, rows, cols, i=0)[source]
Initializes a complex matrix with elements sampled from a uniform distribution.
- Parameters:
module (module) – CuPy/Numpy module.
rows (int) – The number of rows in the matrix.
cols (int) – The number of columns in the matrix.
- Returns:
A complex matrix of size (rows, cols) with elements sampled from a uniform distribution.
- Return type:
array-like
- utils.init_func.ru_weights_ptrbf(module, rows, cols, i=0)[source]
Initializes a complex matrix with elements sampled from a uniform distribution.
- Parameters:
module (module) – CuPy/Numpy module.
rows (int) – The number of rows in the matrix.
cols (int) – The number of columns in the matrix.
i (int, optional) – The number of neurons in input (default is 0).
- Returns:
A complex matrix of size (rows, cols) with elements sampled from a uniform distribution.
- Return type:
array-like
- utils.init_func.zeros(module, rows, cols, i=0)[source]
Initializes a complex matrix with all elements set to zero.
- Parameters:
module (module) – CuPy/Numpy module.
rows (int) – The number of rows in the matrix.
cols (int) – The number of columns in the matrix.
- Returns:
A complex matrix of size (rows, cols) with all elements set to zero.
- Return type:
array-like
- utils.init_func.zeros_real(module, rows, cols, i=0)[source]
Initializes a real matrix with all elements set to zero.
- Parameters:
module (module) – CuPy/Numpy module.
rows (int) – The number of rows in the matrix.
cols (int) – The number of columns in the matrix.
- Returns:
A real matrix of size (rows, cols) with all elements set to zero.
- Return type:
array-like