Advertisement
Guest User

Untitled

a guest
Feb 21st, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. """Takes the output from the decapitated googlenet and transforms the output
  2. from a NxCxWxH to (NxWxH)xCx1x1 that is used as input for the lstm layers.
  3. N = batch size, C = channels, W = grid width, H = grid height."""
  4.  
  5. def generate_intermediate_layers(net):
  6. """Takes the output from the decapitated googlenet and transforms the output
  7. from a NxCxWxH to (NxWxH)xCx1x1 that is used as input for the lstm layers.
  8. N = batch size, C = channels, W = grid width, H = grid height."""
  9.  
  10. net.f(Convolution("post_fc7_conv", bottoms=["inception_5b/output"],
  11. param_lr_mults=[1., 2.], param_decay_mults=[0., 0.],
  12. num_output=1024, kernel_dim=(1, 1),
  13. weight_filler=Filler("gaussian", 0.005),
  14. bias_filler=Filler("constant", 0.)))
  15. net.f(Power("lstm_fc7_conv", scale=0.01, bottoms=["post_fc7_conv"]))
  16. net.f(Transpose("lstm_input", bottoms=["lstm_fc7_conv"]))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement