MCPcopy Create free account
hub / github.com/JonasGeiping/data-poisoning / _split_data

Function _split_data

training_loop.py:101–109  ·  view source on GitHub ↗

Split data for meta update steps and other defenses.

(inputs, labels, p=0.75)

Source from the content-addressed store, hash-verified

99
100
101def _split_data(inputs, labels, p=0.75):
102 """Split data for meta update steps and other defenses."""
103 batch_size = inputs.shape[0]
104 p_actual = int(p * batch_size)
105
106 inputs, temp_targets, = inputs[0:p_actual], inputs[p_actual:]
107 labels, temp_true_labels = labels[0:p_actual], labels[p_actual:]
108 temp_fake_label = labels.mode(keepdim=True)[0].repeat(batch_size - p_actual)
109 return temp_targets, inputs, temp_true_labels, labels, temp_fake_label

Callers 1

training_loop.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected