Added loss parameter to trainable methods