MCPcopy Create free account
hub / github.com/0xShug0/audio.cpp / build_feed_forward

Function build_feed_forward

src/framework/modules/wavlm_encoder.cpp:474–486  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

472}
473
474core::TensorValue build_feed_forward(
475 core::ModuleBuildContext & ctx,
476 const core::TensorValue & hidden_btc,
477 const WavlmEncoderWeights & weights,
478 int64_t layer_index) {
479 const auto & config = weights.config;
480 const std::string prefix = "encoder.layers." + std::to_string(layer_index);
481 auto x = LinearModule({config.hidden_size, config.intermediate_size, true, GGML_PREC_F32})
482 .build(ctx, hidden_btc, linear_weights(weights, prefix + ".fc1"));
483 x = GeluModule({GeluApproximation::ExactErf}).build(ctx, x);
484 return LinearModule({config.intermediate_size, config.hidden_size, true, GGML_PREC_F32})
485 .build(ctx, x, linear_weights(weights, prefix + ".fc2"));
486}
487
488std::vector<core::TensorValue> build_wavlm_graph_layers(
489 core::ModuleBuildContext & ctx,

Callers 1

build_wavlm_graph_layersFunction · 0.70

Calls 5

LinearModuleClass · 0.85
GeluModuleClass · 0.85
linear_weightsFunction · 0.70
to_stringFunction · 0.50
buildMethod · 0.45

Tested by

no test coverage detected