Random Matrix Generation with MXNet

  • Share this:

Code introduction


This function generates a random matrix of specified number of rows and columns using the MXNet library.


Technology Stack : MXNet

Code Type : Python Function

Code Difficulty : Intermediate


                
                    
import mxnet as mx
import random

def generate_random_matrix(rows, cols):
    # Generate a random matrix using MXNet's NDArray
    data = mx.nd.random.normal(0, 1, shape=(rows, cols))
    return data                
              
Tags: