o
    qoi{                     @   s   d Z ddlZddlmZ ddlmZ ddlmZ ejdejfddZ	e	j
Zdejej fd	d
Zdejej fddZdejej fddZdejej fddZdS )a  A collection of Fiddle-based configurations and fiddlers.

The Fiddle recommended pattern is to define one or more "base" configurations
(e.g. `base` in this example). As new experiments are performed, they simply
mutate the base configuration or another experiment. (Fiddle's history tracking
lets you easily determine which experiment set what value when there's a large
stack of incremental experiments.)

> Note: This pattern often works well for iterative product launches and/or
> product versions as well.

If there are multiple "base" configurations, it's often convenient to define
them in separate Python files (modules) for organization purposes.
    N)business_logic)tags)auto_configreturnc                  C   s0   t jddtjdd} t jdd}t | |S )a  A simple base configuration.

  Base configuration functions must be 0-arity, or have defaults for every
  parameter, and must return a `fdl.Config` (or some other `fdl.Buildable`
  subclass).

  Note: these base configurations are often written using `@auto_config` to
  make them easier to read, but they certainly do not have to.

  Best practices include checking in a link to the results of your experiment.
  Your future self (and collaborators) will thank you.

  https://link.to.tensorboard.or.similar/experiment.metadata
  gffffffg      ?float32)wbactivation_dtypezdata.txt)filename)r   MyLinearModelr   ActivationDtypenewMyDataLoaderBulkInferenceRunner)modelloader r   U/home/ubuntu/.local/lib/python3.10/site-packages/fiddle/absl_flags/example/configs.pybase)   s
   r   c                  C      t  } d| j_| S )z|Hypothesis: increasing the w parameter to improve accuracy.

  https://link.to.tensorboard.or.similar/experiment.metadata
     )experiment_1r   r   configr   r   r   experiment_2C      r   c                  C   r   )z}Hypothesis: increasing the b parameter to improve precision.

  https://link.to.tensorboard.or.similar/experiment.metadata
  *   )r   r   r   r   r   r   r   experiment_3M   r   r   c                  C   s   t  } d| _| S )zHypothesis: load from better dataset improves f1 score.

  Note: restarting from baseline.

  https://link.to.tensorboard.or.similar/experiment.metadata
  abc)r   r   r   r   r   r   experiment_4W   s   r   cfgc                 C   s    | j j}| j j| j _|| j _dS )zA sample fiddler.N)r   r   r   )r    tmpr   r   r   swap_weight_and_biasc   s   r"   )__doc__fiddlefdlfiddle.absl_flags.exampler   r   fiddle.experimentalr   r   r   as_buildabler   Configr   r   r   r"   r   r   r   r   <module>   s   

