-2

I have searched Python dictionary but nothing came out.

what is the mean of *\ in the below code?

    def __init__(self, input_dim=(1, 28, 28), 
                 conv_param={'filter_num':30, 'filter_size':5, 'pad':0, 'stride':1},
                 hidden_size=100, output_size=10, weight_init_std=0.01):
        filter_num = conv_param['filter_num']
        filter_size = conv_param['filter_size']
        filter_pad = conv_param['pad']
        filter_stride = conv_param['stride']
        input_size = input_dim[1]
        conv_output_size = (input_size - filter_size + 2*filter_pad) / filter_stride + 1
        pool_output_size = int(filter_num * (conv_output_size/2) * (conv_output_size/2))

        #weight initialize
        self.params = {}
        self.params['W1'] = weight_init_std * \
                            np.random.randn(filter_num, input_dim[0], 5, 5)

#and so on

in

self.params['W1'] = weight_init_std * \
                            np.random.randn(filter_num, input_dim[0], 5, 5)

?

xdurch0
  • 9,905
  • 4
  • 32
  • 38
No Yeah
  • 61
  • 7

1 Answers1

1

This is the same as

self.params['W1'] = weight_init_std * np.random.randn(filter_num, input_dim[0], 5, 5)

* stands for multiplication. The trailing \ is for newline continuation. It informs python that the current expression does not end in this line.

Balaji Ambresh
  • 4,977
  • 2
  • 5
  • 17