MCPcopy Index your code
hub / github.com/pytorch/pytorch / _InceptionModule

Function _InceptionModule

caffe2/experiments/python/convnet_benchmarks.py:391–451  ·  view source on GitHub ↗
(
    model, input_blob, input_depth, output_name, conv1_depth, conv3_depths,
    conv5_depths, pool_depth
)

Source from the content-addressed store, hash-verified

389
390
391def _InceptionModule(
392 model, input_blob, input_depth, output_name, conv1_depth, conv3_depths,
393 conv5_depths, pool_depth
394):
395 # path 1: 1x1 conv
396 conv1 = model.Conv(
397 input_blob, output_name + ":conv1", input_depth, conv1_depth, 1,
398 ('XavierFill', {}), ('ConstantFill', {})
399 )
400 conv1 = model.Relu(conv1, conv1)
401 # path 2: 1x1 conv + 3x3 conv
402 conv3_reduce = model.Conv(
403 input_blob, output_name +
404 ":conv3_reduce", input_depth, conv3_depths[0],
405 1, ('XavierFill', {}), ('ConstantFill', {})
406 )
407 conv3_reduce = model.Relu(conv3_reduce, conv3_reduce)
408 conv3 = model.Conv(
409 conv3_reduce,
410 output_name + ":conv3",
411 conv3_depths[0],
412 conv3_depths[1],
413 3,
414 ('XavierFill', {}),
415 ('ConstantFill', {}),
416 pad=1
417 )
418 conv3 = model.Relu(conv3, conv3)
419 # path 3: 1x1 conv + 5x5 conv
420 conv5_reduce = model.Conv(
421 input_blob, output_name +
422 ":conv5_reduce", input_depth, conv5_depths[0],
423 1, ('XavierFill', {}), ('ConstantFill', {})
424 )
425 conv5_reduce = model.Relu(conv5_reduce, conv5_reduce)
426 conv5 = model.Conv(
427 conv5_reduce,
428 output_name + ":conv5",
429 conv5_depths[0],
430 conv5_depths[1],
431 5,
432 ('XavierFill', {}),
433 ('ConstantFill', {}),
434 pad=2
435 )
436 conv5 = model.Relu(conv5, conv5)
437 # path 4: pool + 1x1 conv
438 pool = model.MaxPool(
439 input_blob,
440 output_name + ":pool",
441 kernel=3,
442 stride=1,
443 pad=1
444 )
445 pool_proj = model.Conv(
446 pool, output_name + ":pool_proj", input_depth, pool_depth, 1,
447 ('XavierFill', {}), ('ConstantFill', {})
448 )

Callers 1

InceptionFunction · 0.70

Calls 4

ConvMethod · 0.80
ReluMethod · 0.80
MaxPoolMethod · 0.80
ConcatMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…