.. _program_listing_file_src_layers_weight.h: Program Listing for File weight.h ================================= |exhale_lsh| :ref:`Return to documentation for file ` (``src/layers/weight.h``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp #pragma once #include "common/options.h" #include "data/corpus.h" #include "graph/expression_graph.h" #include "graph/expression_operators.h" #include "graph/node_initializers.h" namespace marian { class WeightingBase { public: WeightingBase(){}; virtual Expr getWeights(Ptr graph, Ptr batch) = 0; virtual void debugWeighting(std::vector /*weightedMask*/, std::vector /*freqMask*/, Ptr /*batch*/){}; virtual ~WeightingBase() {} }; class DataWeighting : public WeightingBase { protected: std::string weightingType_; public: DataWeighting(std::string weightingType) : WeightingBase(), weightingType_(weightingType){}; Expr getWeights(Ptr graph, Ptr batch) override; }; Ptr WeightingFactory(Ptr options); } // namespace marian