fmt fix
This commit is contained in:
@@ -24,13 +24,7 @@ enum LabelDefinition<T> {
|
|||||||
pub fn make_one_hot<T: RealNumber>(label_idx: usize, num_labels: usize) -> Vec<T> {
|
pub fn make_one_hot<T: RealNumber>(label_idx: usize, num_labels: usize) -> Vec<T> {
|
||||||
let (pos, neg) = (T::from_f64(1f64).unwrap(), T::from_f64(0f64).unwrap());
|
let (pos, neg) = (T::from_f64(1f64).unwrap(), T::from_f64(0f64).unwrap());
|
||||||
(0..num_labels)
|
(0..num_labels)
|
||||||
.map(|idx| {
|
.map(|idx| if idx == label_idx { pos } else { neg })
|
||||||
if idx == label_idx {
|
|
||||||
pos
|
|
||||||
} else {
|
|
||||||
neg
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.collect()
|
.collect()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user