pub struct ContinuousEncoding {
pub depth_weights: Array1<f64>,
pub template_weights: Array2<f64>,
pub gate_weights: Vec<Array2<f64>>,
pub entanglement_weights: Array2<f64>,
pub temperature: f64,
}Expand description
Continuous relaxation for differentiable architecture search.
Fields§
§depth_weights: Array1<f64>Soft depth weights (probability distribution over depths)
template_weights: Array2<f64>Soft template weights per layer position
gate_weights: Vec<Array2<f64>>Soft gate weights per position
entanglement_weights: Array2<f64>Soft entanglement weights per layer
temperature: f64Temperature for softmax
Implementations§
Source§impl ContinuousEncoding
impl ContinuousEncoding
Sourcepub fn uniform(space: &SearchSpace) -> Self
pub fn uniform(space: &SearchSpace) -> Self
Creates a new continuous encoding initialized uniformly.
Sourcepub fn random<R: Rng>(space: &SearchSpace, rng: &mut R) -> Self
pub fn random<R: Rng>(space: &SearchSpace, rng: &mut R) -> Self
Creates a continuous encoding with random initialization.
Sourcepub fn with_temperature(self, temperature: f64) -> Self
pub fn with_temperature(self, temperature: f64) -> Self
Sets the temperature for softmax.
Sourcepub fn sample<R: Rng>(
&self,
space: &SearchSpace,
rng: &mut R,
) -> DiscreteEncoding
pub fn sample<R: Rng>( &self, space: &SearchSpace, rng: &mut R, ) -> DiscreteEncoding
Samples a discrete encoding from this continuous encoding.
Sourcepub fn to_discrete(&self, space: &SearchSpace) -> DiscreteEncoding
pub fn to_discrete(&self, space: &SearchSpace) -> DiscreteEncoding
Converts to the most likely discrete encoding (argmax).
Sourcepub fn update(
&mut self,
discrete: &DiscreteEncoding,
reward: f64,
learning_rate: f64,
)
pub fn update( &mut self, discrete: &DiscreteEncoding, reward: f64, learning_rate: f64, )
Updates weights using gradient-like updates.
Trait Implementations§
Source§impl Clone for ContinuousEncoding
impl Clone for ContinuousEncoding
Source§fn clone(&self) -> ContinuousEncoding
fn clone(&self) -> ContinuousEncoding
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ContinuousEncoding
impl Debug for ContinuousEncoding
Source§impl<'de> Deserialize<'de> for ContinuousEncoding
impl<'de> Deserialize<'de> for ContinuousEncoding
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ContinuousEncoding
impl RefUnwindSafe for ContinuousEncoding
impl Send for ContinuousEncoding
impl Sync for ContinuousEncoding
impl Unpin for ContinuousEncoding
impl UnwindSafe for ContinuousEncoding
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more