Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/topology/activation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ impl ActivationRegistry {
}
}

/// Gets a Vec of all the
/// Gets a Vec of all the activation functions registered. Unless you need an owned value, use [fns][ActivationRegistry::fns].values() instead.
pub fn activations(&self) -> Vec<ActivationFn> {
self.fns.values().cloned().collect()
}
Expand All @@ -77,7 +77,7 @@ impl ActivationRegistry {
let acts = self.activations();

acts.into_iter()
.filter(|a| !scope.contains(ActivationScope::NONE) && scope.contains(a.scope))
.filter(|a| a.scope != ActivationScope::NONE && a.scope.contains(scope))
.collect()
}
}
Expand All @@ -101,7 +101,7 @@ impl Default for ActivationRegistry {

bitflags! {
/// Specifies where an activation function can occur
#[derive(Copy, Clone)]
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
pub struct ActivationScope: u8 {
/// Whether the activation can be applied to the input layer.
const INPUT = 0b001;
Expand All @@ -112,8 +112,8 @@ bitflags! {
/// Whether the activation can be applied to the output layer.
const OUTPUT = 0b100;

/// If this flag is true, it ignores all the rest and does not make the function naturally occur.
const NONE = 0b1000;
/// The activation function will not be randomly placed anywhere
const NONE = 0b000;
}
}

Expand Down