@@ -80,15 +80,16 @@ def create_continuous_state_encoder(self, h_size, activation, num_layers):
8080 kernel_initializer = c_layers .variance_scaling_initializer (1.0 ))
8181 return hidden
8282
83- def create_visual_encoder (self , h_size , activation , num_layers ):
83+ def create_visual_encoder (self , image_input , h_size , activation , num_layers ):
8484 """
8585 Builds a set of visual (CNN) encoders.
86+ :param image_input: The placeholder for the image input to use.
8687 :param h_size: Hidden layer size.
8788 :param activation: What type of activation function to use for layers.
8889 :param num_layers: number of hidden layers to create.
8990 :return: List of hidden layer tensors.
9091 """
91- conv1 = tf .layers .conv2d (self . visual_in [ - 1 ] , 16 , kernel_size = [8 , 8 ], strides = [4 , 4 ],
92+ conv1 = tf .layers .conv2d (image_input , 16 , kernel_size = [8 , 8 ], strides = [4 , 4 ],
9293 activation = tf .nn .elu )
9394 conv2 = tf .layers .conv2d (conv1 , 32 , kernel_size = [4 , 4 ], strides = [2 , 2 ],
9495 activation = tf .nn .elu )
@@ -136,7 +137,7 @@ def create_new_obs(self, num_streams, h_size, num_layers):
136137 hidden_state , hidden_visual = None , None
137138 if brain .number_visual_observations > 0 :
138139 for j in range (brain .number_visual_observations ):
139- encoded_visual = self .create_visual_encoder (h_size , activation_fn , num_layers )
140+ encoded_visual = self .create_visual_encoder (self . visual_in [ j ], h_size , activation_fn , num_layers )
140141 visual_encoders .append (encoded_visual )
141142 hidden_visual = tf .concat (visual_encoders , axis = 1 )
142143 if brain .vector_observation_space_size > 0 :
0 commit comments