Search code examples
pythontensorflowstdstandard-deviation

Caculate the standard deviation be for the vatiable in the matrix created by tensorflow


import tensorflow as tf
input=[50,10]
O1 = layers.fully connected(input, 20, tf.sigmoid)

Why my input is wrong?


Solution

  • I am not sure I understand the question, but...

    The sigmoid layer will output an array with numbers between 0 and 1, but you can't really calculate what the standard deviation will be before feeding your network.

    If you are talking about the matrix that contains the weight parameters, then this depends on how you initialize them. But after the training of the network, the deviation will not be the same as before the training.

    EDIT:

    Ok, so you simply want to calculate the standard deviation for a matrix. In that case see numpy.

    a = np.array([[1, 2], [3, 4]]) # or your 50 by 50 matrix
    np.std(a)