Class to interact with when creating the environment and updating it.
- Academy
- OnLearningLessonEnded
- OnLessonEnded
- OnTeachingEnded
- addAgent
- addRewardToAgent
- addTeacher
- assignTeacherToAgent
- createLogger
- getTeacherData
- reset
- resetTeacherLesson
- resetTeachersAndAgents
- setRewardOfAgent
- step
- toggleLogs
- toggleTeaching
+ new Academy(config?
: AcademyConfig): Academy
Defined in reimprove/academy.ts:53
Parameters:
Name | Type |
---|---|
config? |
AcademyConfig |
Returns: Academy
● agents: Map<string, DQAgent>
Defined in reimprove/academy.ts:48
● assigments: Map<string, string>
Defined in reimprove/academy.ts:50
● config: AcademyConfig
Defined in reimprove/academy.ts:53
● logger: LearningDataLogger
Defined in reimprove/academy.ts:52
● teachers: Map<string, Teacher>
Defined in reimprove/academy.ts:49
● get Teachers(): string[]
Defined in reimprove/academy.ts:209
Gives the list of teachers
constructor
Returns: string[]
▸ OnLearningLessonEnded(teacherName
: string, callback
: function): void
Defined in reimprove/academy.ts:152
Callback which will be called each time the model's fit ends after the end of the lesson.
constructor
Parameters:
■ teacherName
: string
The target teacher which will call the callback
■ callback
: function
The callback, giving the teacher name
▸ (teacher
: string): void
Parameters:
Name | Type |
---|---|
teacher |
string |
Returns: void
▸ OnLessonEnded(teacherName
: string, callback
: function): void
Defined in reimprove/academy.ts:163
Callback called when a lesson is ended
constructor
Parameters:
■ teacherName
: string
The target teacher which will call the callback
■ callback
: function
The callback, giving the teacher name and the index of the just ended lesson.
▸ (teacher
: string, lessonNumber
: number): void
Parameters:
Name | Type |
---|---|
teacher |
string |
lessonNumber |
number |
Returns: void
▸ OnTeachingEnded(teacherName
: string, callback
: function): void
Defined in reimprove/academy.ts:174
Callback called when a lesson is ended
constructor
Parameters:
■ teacherName
: string
The target teacher which will call the callback
■ callback
: function
The callback, giving the teacher name
▸ (teacher
: string): void
Parameters:
Name | Type |
---|---|
teacher |
string |
Returns: void
▸ addAgent(config
: BuildAgentConfig, name?
: string): string
Defined in reimprove/academy.ts:66
Parameters:
Name | Type |
---|---|
config |
BuildAgentConfig |
name? |
string |
Returns: string
▸ addRewardToAgent(name
: string, reward
: number): void
Defined in reimprove/academy.ts:131
Add a reward to an agent, given its name. Be careful to give a reward normalized between -1.0 and 1.0 for an optimal learn.
Parameters:
Name | Type | Description |
---|---|---|
name |
string | - |
reward |
number |
Returns: void
▸ addTeacher(config?
: TeachingConfig, name?
: string): string
Defined in reimprove/academy.ts:76
Parameters:
Name | Type |
---|---|
config? |
TeachingConfig |
name? |
string |
Returns: string
▸ assignTeacherToAgent(agentName
: string, teacherName
: string): void
Defined in reimprove/academy.ts:86
Parameters:
Name | Type |
---|---|
agentName |
string |
teacherName |
string |
Returns: void
▸ createLogger(parent
: HTMLElement
): void
Defined in reimprove/academy.ts:226
If not given in the configuration options in the constructor, you can choose to create the logger here
Parameters:
Name | Type | Description |
---|---|---|
parent |
HTMLElement |
Returns: void
▸ getTeacherData(name
: string): TeacherTrackingInformation
Defined in reimprove/academy.ts:218
Used for logs, returning the tracking informations of a teacher, see TeacherTrackingInformation
Parameters:
Name | Type |
---|---|
name |
string |
Returns: TeacherTrackingInformation
▸ reset(): void
Defined in reimprove/academy.ts:190
Function resetting everything in the academy, calling first resetTeachersAndAgents, then cleaning everything concerning teachers and agents.
Returns: void
▸ resetTeacherLesson(teacherName
: string): void
Defined in reimprove/academy.ts:200
Resets to 0 the current state of the lesson. It cannot forget
Parameters:
Name | Type | Description |
---|---|---|
teacherName |
string |
Returns: void
▸ resetTeachersAndAgents(): void
Defined in reimprove/academy.ts:182
Function to reset everything from teachers and agents (resetting parameters of teachers, and resetting memory and parameters of agents).
Returns: void
▸ setRewardOfAgent(name
: string, reward
: number): void
Defined in reimprove/academy.ts:141
In case where you just want to clearly set the agent's current reward for this step.
Parameters:
Name | Type | Description |
---|---|---|
name |
string | - |
reward |
number |
Returns: void
▸ step(inputs
: AcademyStepInput[] | AcademyStepInput): Promise<Map<string, number>>
Defined in reimprove/academy.ts:102
A step in the academy, giving the teachers their inputs, and propagating it to agents. Returns a [[Map]] where you just have to pick for each agent's name its decision. At each step all the rewards are reset to 0.
Parameters:
Name | Type | Description |
---|---|---|
inputs |
AcademyStepInput[] | AcademyStepInput | You can give only one input as well as an array of inputs. |
Returns: Promise<Map<string, number>>
▸ toggleLogs(memory
: boolean): void
Defined in reimprove/academy.ts:236
Method to toggle logs, taking an argument to toggle memory logs.
Parameters:
Name | Type | Default | Description |
---|---|---|---|
memory |
boolean | false |
Returns: void
▸ toggleTeaching(teacher
: string, toggle
: boolean): void
Defined in reimprove/academy.ts:243
Parameters:
Name | Type |
---|---|
teacher |
string |
toggle |
boolean |
Returns: void