adjust cap to trainable units