Skip to content

Instantly share code, notes, and snippets.

@AurelianTactics
Created August 23, 2018 21:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AurelianTactics/2aef4ba15117f2a4438aa765c62648c2 to your computer and use it in GitHub Desktop.
Save AurelianTactics/2aef4ba15117f2a4438aa765c62648c2 to your computer and use it in GitHub Desktop.
modified visionnet code
from ray.rllib.models.misc import get_activation_fn, flatten, AddCoords
...
def _build_layers(self, inputs, num_outputs, options):
if options.get('custom_options', {}).get('add_coordinates'):
with_r = False
if options.get('custom_options', {}).get('add_coords_with_r'):
with_r = True
addcoords = AddCoords(x_dim=int(np.shape(inputs)[1]), y_dim=int(np.shape(inputs)[1]),with_r=with_r)
inputs = addcoords(inputs)
print("visionnet: Added coordinate filters tensor size is now {}".format(np.shape(inputs)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment