use super::super::nam_json::{NamConfig, NamLayerConfig, NamModelData, WeightsLayout};
pub fn make_fallback_model_data() -> NamModelData {
NamModelData {
version: None,
architecture: "WaveNet".to_string(), config: make_standard_wavenet_config(),
weights: Vec::new(),
sample_rate: None,
metadata: None,
weights_layout: WeightsLayout::Original,
}
}
pub fn make_standard_wavenet_config() -> NamConfig {
let std_dilations = vec![1, 2, 4, 8, 16, 32, 64, 128, 256, 512];
let l0 = NamLayerConfig {
input_size: Some(1),
condition_size: Some(1),
head_size: Some(8),
channels: Some(16), kernel_size: Some(3), dilations: Some(std_dilations.clone()),
activation: Some("Tanh".to_string()),
gated: Some(false),
head_bias: Some(false),
..Default::default()
};
let l1 = NamLayerConfig {
input_size: Some(1),
condition_size: Some(1),
head_size: Some(8),
channels: Some(16),
kernel_size: Some(3),
dilations: Some(std_dilations),
activation: Some("Tanh".to_string()),
gated: Some(false),
head_bias: Some(true),
..Default::default()
};
NamConfig {
layers: vec![l0, l1],
head: Some(serde_json::Value::Null),
head_scale: Some(0.02), num_layers: None,
hidden_size: None,
receptive_field: None,
bias: None,
submodels: None,
..Default::default()
}
}