Instead of using np.asscalar and detach().numpy(), the code now uses mi.item() directly to append the value to miHistory. This is a more concise and efficient way of obtaining the scalar value of a tensor.
The return statement for the MI value was modified to directly return mi.item() instead of using np.asscalar and data.numpy().
Instead of using np.asscalar and detach().numpy(), the code now uses mi.item() directly to append the value to miHistory. This is a more concise and efficient way of obtaining the scalar value of a tensor.
The return statement for the MI value was modified to directly return mi.item() instead of using np.asscalar and data.numpy().