Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Urgent hotfix #44

Merged
merged 3 commits into from
Apr 16, 2024
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