rdb

package
v0.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 9, 2023 License: MIT Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunAutoMigrate

func RunAutoMigrate(db *gorm.DB)

RunAutoMigrate runs Auto-Migration. This will ONLY create tables, missing columns and missing indexes, and WON’T change existing column’s type or delete unused columns to protect your data.

Types

type GoptunaAttr added in v0.4.0

type GoptunaAttr struct {
	Library string `json:"library"`
	Param   string `json:"param"`
}

type Storage

type Storage struct {
	// contains filtered or unexported fields
}

Storage stores data in your relational databases. Deprecated: Please use `github.com/c-bata/goptuna/rdb.v2` package.

func NewStorage

func NewStorage(db *gorm.DB) *Storage

NewStorage returns new RDB storage. Deprecated: Please use `github.com/c-bata/goptuna/rdb.v2` package.

func (*Storage) CloneTrial added in v0.3.0

func (s *Storage) CloneTrial(studyID int, baseTrial goptuna.FrozenTrial) (int, error)

CloneTrial creates new Trial from the given base Trial.

func (*Storage) CreateNewStudy added in v0.2.0

func (s *Storage) CreateNewStudy(name string) (int, error)

CreateNewStudy creates study and returns studyID.

func (*Storage) CreateNewTrial added in v0.2.0

func (s *Storage) CreateNewTrial(studyID int) (int, error)

CreateNewTrial creates trial and returns trialID.

func (*Storage) DeleteStudy added in v0.2.0

func (s *Storage) DeleteStudy(studyID int) error

DeleteNewStudy creates study and returns studyID.

func (*Storage) GetAllStudySummaries

func (s *Storage) GetAllStudySummaries() ([]goptuna.StudySummary, error)

GetAllStudySummaries returns all study summaries.

func (*Storage) GetAllTrials

func (s *Storage) GetAllTrials(studyID int) ([]goptuna.FrozenTrial, error)

GetAllTrials returns the all trials.

func (*Storage) GetBestTrial

func (s *Storage) GetBestTrial(studyID int) (goptuna.FrozenTrial, error)

GetBestTrial returns the best trial.

func (*Storage) GetStudyDirection

func (s *Storage) GetStudyDirection(studyID int) (goptuna.StudyDirection, error)

GetStudyDirection returns study direction of the objective.

func (*Storage) GetStudyIDFromName

func (s *Storage) GetStudyIDFromName(name string) (int, error)

GetStudyIDFromName return the study id from study name.

func (*Storage) GetStudyIDFromTrialID

func (s *Storage) GetStudyIDFromTrialID(trialID int) (int, error)

GetStudyIDFromTrialID return the study id from trial id.

func (*Storage) GetStudyNameFromID

func (s *Storage) GetStudyNameFromID(studyID int) (string, error)

GetStudyNameFromID return the study name from study id.

func (*Storage) GetStudySystemAttrs

func (s *Storage) GetStudySystemAttrs(studyID int) (map[string]string, error)

GetStudySystemAttrs to restore the attributes for the system.

func (*Storage) GetStudyUserAttrs

func (s *Storage) GetStudyUserAttrs(studyID int) (map[string]string, error)

GetStudyUserAttrs to restore the attributes for the user.

func (*Storage) GetTrial

func (s *Storage) GetTrial(trialID int) (goptuna.FrozenTrial, error)

GetTrial returns Trial.

func (*Storage) GetTrialNumberFromID

func (s *Storage) GetTrialNumberFromID(trialID int) (int, error)

GetTrialNumberFromID returns the trial's number.

func (*Storage) GetTrialParam

func (s *Storage) GetTrialParam(trialID int, paramName string) (float64, error)

GetTrialParam returns the internal parameter of the trial

func (*Storage) GetTrialParams

func (s *Storage) GetTrialParams(trialID int) (map[string]interface{}, error)

GetTrialParams returns the external parameters in the trial

func (*Storage) GetTrialSystemAttrs

func (s *Storage) GetTrialSystemAttrs(trialID int) (map[string]string, error)

GetTrialSystemAttrs to restore the attributes for the system.

func (*Storage) GetTrialUserAttrs

func (s *Storage) GetTrialUserAttrs(trialID int) (map[string]string, error)

GetTrialUserAttrs to restore the attributes for the user.

func (*Storage) SetStudyDirection

func (s *Storage) SetStudyDirection(studyID int, direction goptuna.StudyDirection) error

SetStudyDirection sets study direction of the objective.

func (*Storage) SetStudySystemAttr

func (s *Storage) SetStudySystemAttr(studyID int, key string, value string) error

SetStudySystemAttr to store the value for the system.

func (*Storage) SetStudyUserAttr

func (s *Storage) SetStudyUserAttr(studyID int, key string, value string) error

SetStudyUserAttr to store the value for the user.

func (*Storage) SetTrialIntermediateValue

func (s *Storage) SetTrialIntermediateValue(trialID int, step int, value float64) error

SetTrialIntermediateValue sets the intermediate value of trial. While sets the intermediate value, trial.value is also updated.

func (*Storage) SetTrialParam

func (s *Storage) SetTrialParam(
	trialID int,
	paramName string,
	paramValueInternal float64,
	distribution interface{},
) error

SetTrialParam sets the sampled parameters of trial.

func (*Storage) SetTrialState

func (s *Storage) SetTrialState(trialID int, state goptuna.TrialState) error

SetTrialState sets the state of trial.

func (*Storage) SetTrialSystemAttr

func (s *Storage) SetTrialSystemAttr(trialID int, key string, value string) error

SetTrialSystemAttr to store the value for the system.

func (*Storage) SetTrialUserAttr

func (s *Storage) SetTrialUserAttr(trialID int, key string, value string) error

SetTrialUserAttr to store the value for the user.

func (*Storage) SetTrialValue

func (s *Storage) SetTrialValue(trialID int, value float64) error

SetTrialValue sets the value of trial.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL