DAPPER (Document Analysis, Processing, and Pattern Extraction Repository)
Statistical Learning Final Project for Document Classification
 
Loading...
Searching...
No Matches
tune Namespace Reference

Functions

 get_value_from_trial (optuna.trial.Trial trial, Dict[str, Any] param_config)
 
 set_nested_value (Dict[str, Any] d, str keys, Any value)
 
float objective (optuna.trial.Trial trial, Dict[str, Any] base_config)
 

Variables

 logger = get_standard_logger("tune")
 
 parser = argparse.ArgumentParser(description="Run hyperparameter tuning using Optuna")
 
 type
 
 str
 
 required
 
 help
 
 int
 
 default
 
 args = parser.parse_args()
 
 base_config = load_config(args.config)
 
 model_name = base_config.get('model', {}).get('name', 'unknown_model')
 
str study_name = args.study_name if args.study_name else f"{model_name}_study"
 
 n_trials = args.n_trials
 
 storage = args.storage
 
 study
 
objective objective_with_config = lambda trial(trial, base_config)
 
 best_trial = study.best_trial
 
 exc_info
 

Function Documentation

◆ get_value_from_trial()

tune.get_value_from_trial ( optuna.trial.Trial  trial,
Dict[str, Any]  param_config 
)
Suggests a value for a parameter based on its configuration.

◆ objective()

float tune.objective ( optuna.trial.Trial  trial,
Dict[str, Any]  base_config 
)
Objective function for Optuna to minimize/maximize.

◆ set_nested_value()

tune.set_nested_value ( Dict[str, Any]  d,
str  keys,
Any  value 
)
Sets a value in a nested dictionary using a dot-separated key string.

Variable Documentation

◆ args

tune.args = parser.parse_args()

◆ base_config

tune.base_config = load_config(args.config)

◆ best_trial

tune.best_trial = study.best_trial

◆ default

tune.default

◆ exc_info

tune.exc_info

◆ help

tune.help

◆ int

tune.int

◆ logger

tune.logger = get_standard_logger("tune")

◆ model_name

tune.model_name = base_config.get('model', {}).get('name', 'unknown_model')

◆ n_trials

tune.n_trials = args.n_trials

◆ objective_with_config

tune.objective_with_config = lambda trial(trial, base_config)

◆ parser

tune.parser = argparse.ArgumentParser(description="Run hyperparameter tuning using Optuna")

◆ required

tune.required

◆ storage

tune.storage = args.storage

◆ str

tune.str

◆ study

tune.study
Initial value:
1= optuna.create_study(
2 study_name=study_name,
3 storage=storage,
4 direction='maximize',
5 load_if_exists=True # Resume study if storage and name match
6 )

◆ study_name

str tune.study_name = args.study_name if args.study_name else f"{model_name}_study"

◆ type

tune.type