neural-amp-modeler

Neural network emulator for guitar amplifiers
Log | Files | Refs | README | LICENSE

metadata.py (1804B)


      1 # File: metadata.py
      2 # Created Date: Sunday May 19th 2024
      3 # Author: Steven Atkinson ([email protected])
      4 
      5 """
      6 Information from the simplified trainers that is good to know about.
      7 """
      8 
      9 # This isn't part of ../metadata because it's not necessarily worth knowning about--only
     10 # if you're using the simplified trainers!
     11 
     12 from typing import List as _List, Optional as _Optional
     13 
     14 from pydantic import BaseModel as _BaseModel
     15 
     16 # The key under which the metadata are saved in the .nam:
     17 TRAINING_KEY = "training"
     18 
     19 
     20 class Settings(_BaseModel):
     21     """
     22     User-provided settings
     23     """
     24 
     25     ignore_checks: bool
     26 
     27 
     28 class LatencyCalibrationWarnings(_BaseModel):
     29     """
     30     Things that aren't necessarily wrong with the latency calibration but are
     31     worth looking into.
     32 
     33     :param matches_lookahead: The calibrated latency is as far forard as
     34         possible, i.e. the very first sample we looked at tripped the trigger.
     35         That's probably not a coincidence but the trigger is too sensitive.
     36     :param disagreement_too_high: The range of the latency estimates is greater
     37         than the max_disagreement_threshold. Indication that something may have
     38         gone wrong.
     39     """
     40 
     41     matches_lookahead: bool
     42     disagreement_too_high: bool
     43 
     44 
     45 class LatencyCalibration(_BaseModel):
     46     algorithm_version: int
     47     delays: _List[int]
     48     safety_factor: int
     49     recommended: int
     50     warnings: LatencyCalibrationWarnings
     51 
     52 
     53 class Latency(_BaseModel):
     54     """
     55     Information about the latency
     56     """
     57 
     58     manual: _Optional[int]
     59     calibration: LatencyCalibration
     60 
     61 
     62 class DataChecks(_BaseModel):
     63     version: int
     64     passed: bool
     65 
     66 
     67 class Data(_BaseModel):
     68     latency: Latency
     69     checks: DataChecks
     70 
     71 
     72 class TrainingMetadata(_BaseModel):
     73     settings: Settings
     74     data: Data
     75     validation_esr: _Optional[float]