You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: context_query.rs
    path of file: ./repos/qdrant/lib/segment/src/vector_storage/query
    
    the code of the file until where you have to start completion: use std::iter;

use common::math::fast_sigmoid;
use common::types::ScoreType;
use itertools::Itertools;

use super::{Query, TransformInto};
use crate::common::operation_error::OperationResult;
use crate::data_types::vectors::{QueryVecto
    
    pub fn loss_by(&self, similarity: impl Fn(&T) -> ScoreType) -> ScoreType {
        const MARGIN: ScoreType = ScoreType::EPSILON;

        let positive = similarity(&self.positive);
        let negative = similarity(&self.negative);

        let difference = positive - negative - MARGIN;

        fast_sigmoid(ScoreType::min(difference, 0.0))
    }