pub struct ContrastiveAugmentation { /* private fields */ }Expand description
SimCLR-style contrastive augmentation pipeline.
§Example
use ruvector_cnn::contrastive::ContrastiveAugmentation;
let aug = ContrastiveAugmentation::builder()
.crop_scale(0.08, 1.0)
.horizontal_flip_prob(0.5)
.color_jitter(0.4, 0.4, 0.4, 0.1)
.output_size(224, 224)
.build();
// Generate two augmented views of an image (requires augmentation feature)
// let (view1, view2) = aug.generate_pair(&image)?;Implementations§
Source§impl ContrastiveAugmentation
impl ContrastiveAugmentation
Sourcepub fn builder() -> ContrastiveAugmentationBuilder
pub fn builder() -> ContrastiveAugmentationBuilder
Create a builder for ContrastiveAugmentation.
Sourcepub fn config(&self) -> &AugmentationConfig
pub fn config(&self) -> &AugmentationConfig
Get the current configuration.
Trait Implementations§
Source§impl Clone for ContrastiveAugmentation
impl Clone for ContrastiveAugmentation
Source§fn clone(&self) -> ContrastiveAugmentation
fn clone(&self) -> ContrastiveAugmentation
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 ContrastiveAugmentation
impl Debug for ContrastiveAugmentation
Auto Trait Implementations§
impl Freeze for ContrastiveAugmentation
impl RefUnwindSafe for ContrastiveAugmentation
impl Send for ContrastiveAugmentation
impl Sync for ContrastiveAugmentation
impl Unpin for ContrastiveAugmentation
impl UnsafeUnpin for ContrastiveAugmentation
impl UnwindSafe for ContrastiveAugmentation
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