파이썬 What is the difference between 'SAME' and 'VALID' padding in tf.nn.max_pool of tensorflow?
tensorflow 의 tf.nn.max_pool 에서 'SAME'패딩과 'VALID'패딩의 차이점은 무엇입니까? 제 생각에는 'VALID'는 최대 풀을 할 때 가장자리 외부에 제로 패딩이 없음을 의미합니다. 해결 방법 더 명확하게하기 위해 예를 들어 보겠습니다. 출력 모양은 다음과 같습니다. x = tf.constant([[1., 2., 3.], [4., 5., 6.]]) x = tf.reshape(x, [1, 2, 3, 1]) # give a shape accepted by tf.nn.max_pool valid_pad = tf.nn.max_pool(x, [1, 2, 2, 1], [1, 2, 2, 1], padding='VALID') same_pad = tf.nn.max_pool(x, [1, 2, 2,..
2020. 11. 3.
파이썬 TypeError : 'Tensor'개체는 TensorFlow에서 항목 할당을 지원하지 않습니다.
이 코드를 실행하려고합니다. outputs, states = rnn.rnn(lstm_cell, x, initial_state=initial_state, sequence_length=real_length) tensor_shape = outputs.get_shape() for step_index in range(tensor_shape[0]): word_index = self.x[:, step_index] word_index = tf.reshape(word_index, [-1,1]) index_weight = tf.gather(word_weight, word_index) outputs[step_index, :, :]=tf.mul(outputs[step_index, :, :] , index_weight) 하지만..
2020. 11. 3.