Я пытаюсь создать словарь весов на слой для моей реализации ANN.
Проблема в том, что, хотя я создаю словарь со строками в качестве ключей и тензорами в качестве значений, я не знаю, как их отобразить, когда я вызываю init_weight
метод
def init_weights(topology):
#topology: dimensions of the network
for i in range(1,len(topology)):
parameters['W' + str(i)] = tf.Variable(tf.random_normal([topology[i-1],topology[i]]))
Вывод метода показывает следующее:
{'W1': <tf.Variable 'Variable_1:0' shape=(2, 5) dtype=float32_ref>,
'W2': <tf.Variable 'Variable_3:0' shape=(5, 5) dtype=float32_ref>,
'W3': <tf.Variable 'Variable_5:0' shape=(5, 5) dtype=float32_ref>,
'W4': <tf.Variable 'Variable_7:0' shape=(5, 10) dtype=float32_ref>}
Как можно распечатать матрицы весов?