MCPcopy Create free account
hub / github.com/NVIDIA/MinkowskiEngine / train

Function train

tests/python/network_speed.py:97–112  ·  view source on GitHub ↗
(coords, colors, model)

Source from the content-addressed store, hash-verified

95
96
97def train(coords, colors, model):
98 # Measure time
99 timer = Timer()
100 for i in range(5):
101 # Feed-forward pass and get the prediction
102 timer.tic()
103 sinput = ME.SparseTensor(
104 colors,
105 coords,
106 device=device,
107 allocator_type=ME.GPUMemoryAllocatorType.PYTORCH,
108 )
109 logits = model(sinput)
110 logits.F.sum().backward()
111 timer.toc()
112 return timer.min_time, len(logits)
113
114
115def test_network(coords, feats, model, batch_sizes, forward_only=True):

Callers 1

test_networkFunction · 0.70

Calls 4

ticMethod · 0.95
tocMethod · 0.95
TimerClass · 0.90
backwardMethod · 0.45

Tested by 1

test_networkFunction · 0.56