diff --git a/data/FluxTraining@dev/doc/CHANGELOG.md.json b/data/FluxTraining@dev/doc/CHANGELOG.md.json index 3855cafb5..350fefcf5 100644 --- a/data/FluxTraining@dev/doc/CHANGELOG.md.json +++ b/data/FluxTraining@dev/doc/CHANGELOG.md.json @@ -1 +1 @@ -{"attributes":{"backlinks":[],"path":"/home/runner/.julia/packages/FluxTraining/xCOPx/CHANGELOG.md","title":"News"},"tag":"document","children":[{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"h1","children":["News"],"type":"node"},{"attributes":{},"tag":"h2","children":["Unreleased"],"type":"node"},{"attributes":{},"tag":"h3","children":["Added"],"type":"node"},{"attributes":{},"tag":"ul","children":[{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["Support for ",{"attributes":{"href":"https://github.com/FluxML/Optimisers.jl","title":""},"tag":"a","children":["Optimisers.jl"],"type":"node"}," https://github.com/FluxML/FluxTraining.jl/pull/114."],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"h2","children":["[0.3.0] - 04.04.2022"],"type":"node"},{"attributes":{},"tag":"h3","children":["Added"],"type":"node"},{"attributes":{},"tag":"ul","children":[{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["Short-hand ",{"attributes":{},"tag":"code","children":["Learner"],"type":"node"}," method ",{"attributes":{},"tag":"code","children":["Learner(model, lossfn[; data, optim, callbacks, kwargs...])"],"type":"node"},". The old method still exists but use is discouraged."],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["Compatibility with Flux.jl v0.13 once released"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":[{"attributes":{"href":"https://fluxml.ai/FluxTraining.jl/dev/i/?id=documents%2FREADME.md","title":""},"tag":"a","children":["Pollen.jl doucmentation frontend"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"h3","children":["Changed"],"type":"node"},{"attributes":{},"tag":"ul","children":[{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["(BREAKING) Hyperparameter scheduling now uses ParameterSchedules.jl instead of Animations.jl for defining schedules. See ",{"attributes":{"href":"https://fluxml.ai/FluxTraining.jl/dev/documents/docs/tutorials/hyperparameters.md/","title":""},"tag":"a","children":["the docs"],"type":"node"},"."],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["Fixes on documentation pages"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"h2","children":["[0.2.0]"],"type":"node"},{"attributes":{},"tag":"h3","children":["Added"],"type":"node"},{"attributes":{},"tag":"ul","children":[{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["New training loop API that is easier to extend. Defining a ",{"attributes":{},"tag":"code","children":["Phase"],"type":"node"}," and ",{"attributes":{},"tag":"code","children":["step!"],"type":"node"}," is all you need. See ",{"attributes":{"href":"docs/tutorials/training.md","title":"","document_id":"FluxTraining@dev/doc/docs/tutorials/training.md"},"tag":"reference","children":["the new tutorial"],"type":"node"}," and ",{"attributes":{"href":"docs/reference/training.md","title":"","document_id":"FluxTraining@dev/doc/docs/reference/training.md"},"tag":"reference","children":["the new reference"],"type":"node"},"."],"type":"node"},{"attributes":{},"tag":"ul","children":[{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["Relevant functions: ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.epoch!"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["epoch!"],"type":"node"}],"type":"node"},", ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.step!"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["step!"],"type":"node"}],"type":"node"},", ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.runstep"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["runstep"],"type":"node"}],"type":"node"},", ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.runepoch"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["runepoch"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["Added ",{"attributes":{},"tag":"code","children":["CHANGELOG.md"],"type":"node"}," (this file)"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":[{"attributes":{"href":"#","title":""},"tag":"a","children":[{"attributes":{},"tag":"code","children":["AbstractValidationPhase"],"type":"node"}],"type":"node"}," as supertype for validation phases"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["Documentation for callback helpers on ",{"attributes":{"href":"docs/callbacks/reference.md","title":"","document_id":"FluxTraining@dev/doc/docs/callbacks/reference.md"},"tag":"reference","children":["reference page"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"h3","children":["Changed"],"type":"node"},{"attributes":{},"tag":"ul","children":[{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":[{"attributes":{},"tag":"code","children":["Batch*"],"type":"node"}," renamed to ",{"attributes":{},"tag":"code","children":["Step*"],"type":"node"},":"],"type":"node"},{"attributes":{},"tag":"ul","children":[{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["events: ",{"attributes":{},"tag":"code","children":["BatchBegin"],"type":"node"}," now ",{"attributes":{},"tag":"code","children":["StepBegin"],"type":"node"},", ",{"attributes":{},"tag":"code","children":["BatchEnd"],"type":"node"}," now ",{"attributes":{},"tag":"code","children":["StepEnd"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":[{"attributes":{},"tag":"code","children":["CancelBatchException"],"type":"node"}," now ",{"attributes":{},"tag":"code","children":["CancelStepException"],"type":"node"},"."],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["field ",{"attributes":{},"tag":"code","children":["Learner.batch"],"type":"node"}," now ",{"attributes":{},"tag":"code","children":["Learner.step"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":[{"attributes":{},"tag":"code","children":["Learner.step/batch"],"type":"node"}," is no longer a special ",{"attributes":{},"tag":"code","children":["struct"],"type":"node"}," but now a ",{"attributes":{},"tag":"code","children":["PropDict"],"type":"node"},", allowing you to set arbitrary fields."],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":[{"attributes":{},"tag":"code","children":["Learner.model"],"type":"node"}," can now be a ",{"attributes":{},"tag":"code","children":["NamedTuple/Tuple"],"type":"node"}," of models for use in custom training loops. Likewise, ",{"attributes":{},"tag":"code","children":["learner.params"],"type":"node"}," now resembles the structure of ",{"attributes":{},"tag":"code","children":["learner.model"],"type":"node"},", allowing separate access to parameters of different models."],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["Callbacks"],"type":"node"},{"attributes":{},"tag":"ul","children":[{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["Added ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.init!"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["init!"],"type":"node"}],"type":"node"}," method for callback initilization, replacing the ",{"attributes":{},"tag":"code","children":["Init"],"type":"node"}," event which required a ",{"attributes":{},"tag":"code","children":["Phase"],"type":"node"}," to implement."],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":[{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.Scheduler"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["Scheduler"],"type":"node"}],"type":"node"}," now has internal step counter and no longer relies on ",{"attributes":{},"tag":"code","children":["Recorder"],"type":"node"},"'s history. This makes it easier to replace the scheduler without needing to offset the new schedules."],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":[{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.EarlyStopping"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["EarlyStopping"],"type":"node"}],"type":"node"}," callback now uses criteria from ",{"attributes":{"href":"https://github.com/ablaom/EarlyStopping.jl","title":""},"tag":"a","children":["EarlyStopping.jl"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"h3","children":["Removed"],"type":"node"},{"attributes":{},"tag":"ul","children":[{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["Removed old training API. Methods ",{"attributes":{},"tag":"code","children":["fitbatch!"],"type":"node"},", ",{"attributes":{},"tag":"code","children":["fitbatchphase!"],"type":"node"},", ",{"attributes":{},"tag":"code","children":["fitepoch!"],"type":"node"},", ",{"attributes":{},"tag":"code","children":["fitepochphase!"],"type":"node"}," have all been removed."],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file +{"attributes":{"backlinks":[],"path":"/home/runner/.julia/packages/FluxTraining/imTF4/CHANGELOG.md","title":"News"},"tag":"document","children":[{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"h1","children":["News"],"type":"node"},{"attributes":{},"tag":"h2","children":["Unreleased"],"type":"node"},{"attributes":{},"tag":"h3","children":["Added"],"type":"node"},{"attributes":{},"tag":"ul","children":[{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["Support for ",{"attributes":{"href":"https://github.com/FluxML/Optimisers.jl","title":""},"tag":"a","children":["Optimisers.jl"],"type":"node"}," https://github.com/FluxML/FluxTraining.jl/pull/114."],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"h2","children":["[0.3.0] - 04.04.2022"],"type":"node"},{"attributes":{},"tag":"h3","children":["Added"],"type":"node"},{"attributes":{},"tag":"ul","children":[{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["Short-hand ",{"attributes":{},"tag":"code","children":["Learner"],"type":"node"}," method ",{"attributes":{},"tag":"code","children":["Learner(model, lossfn[; data, optim, callbacks, kwargs...])"],"type":"node"},". The old method still exists but use is discouraged."],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["Compatibility with Flux.jl v0.13 once released"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":[{"attributes":{"href":"https://fluxml.ai/FluxTraining.jl/dev/i/?id=documents%2FREADME.md","title":""},"tag":"a","children":["Pollen.jl doucmentation frontend"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"h3","children":["Changed"],"type":"node"},{"attributes":{},"tag":"ul","children":[{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["(BREAKING) Hyperparameter scheduling now uses ParameterSchedules.jl instead of Animations.jl for defining schedules. See ",{"attributes":{"href":"https://fluxml.ai/FluxTraining.jl/dev/documents/docs/tutorials/hyperparameters.md/","title":""},"tag":"a","children":["the docs"],"type":"node"},"."],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["Fixes on documentation pages"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"h2","children":["[0.2.0]"],"type":"node"},{"attributes":{},"tag":"h3","children":["Added"],"type":"node"},{"attributes":{},"tag":"ul","children":[{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["New training loop API that is easier to extend. Defining a ",{"attributes":{},"tag":"code","children":["Phase"],"type":"node"}," and ",{"attributes":{},"tag":"code","children":["step!"],"type":"node"}," is all you need. See ",{"attributes":{"href":"docs/tutorials/training.md","title":"","document_id":"FluxTraining@dev/doc/docs/tutorials/training.md"},"tag":"reference","children":["the new tutorial"],"type":"node"}," and ",{"attributes":{"href":"docs/reference/training.md","title":"","document_id":"FluxTraining@dev/doc/docs/reference/training.md"},"tag":"reference","children":["the new reference"],"type":"node"},"."],"type":"node"},{"attributes":{},"tag":"ul","children":[{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["Relevant functions: ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.epoch!"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["epoch!"],"type":"node"}],"type":"node"},", ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.step!"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["step!"],"type":"node"}],"type":"node"},", ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.runstep"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["runstep"],"type":"node"}],"type":"node"},", ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.runepoch"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["runepoch"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["Added ",{"attributes":{},"tag":"code","children":["CHANGELOG.md"],"type":"node"}," (this file)"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":[{"attributes":{"href":"#","title":""},"tag":"a","children":[{"attributes":{},"tag":"code","children":["AbstractValidationPhase"],"type":"node"}],"type":"node"}," as supertype for validation phases"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["Documentation for callback helpers on ",{"attributes":{"href":"docs/callbacks/reference.md","title":"","document_id":"FluxTraining@dev/doc/docs/callbacks/reference.md"},"tag":"reference","children":["reference page"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"h3","children":["Changed"],"type":"node"},{"attributes":{},"tag":"ul","children":[{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":[{"attributes":{},"tag":"code","children":["Batch*"],"type":"node"}," renamed to ",{"attributes":{},"tag":"code","children":["Step*"],"type":"node"},":"],"type":"node"},{"attributes":{},"tag":"ul","children":[{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["events: ",{"attributes":{},"tag":"code","children":["BatchBegin"],"type":"node"}," now ",{"attributes":{},"tag":"code","children":["StepBegin"],"type":"node"},", ",{"attributes":{},"tag":"code","children":["BatchEnd"],"type":"node"}," now ",{"attributes":{},"tag":"code","children":["StepEnd"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":[{"attributes":{},"tag":"code","children":["CancelBatchException"],"type":"node"}," now ",{"attributes":{},"tag":"code","children":["CancelStepException"],"type":"node"},"."],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["field ",{"attributes":{},"tag":"code","children":["Learner.batch"],"type":"node"}," now ",{"attributes":{},"tag":"code","children":["Learner.step"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":[{"attributes":{},"tag":"code","children":["Learner.step/batch"],"type":"node"}," is no longer a special ",{"attributes":{},"tag":"code","children":["struct"],"type":"node"}," but now a ",{"attributes":{},"tag":"code","children":["PropDict"],"type":"node"},", allowing you to set arbitrary fields."],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":[{"attributes":{},"tag":"code","children":["Learner.model"],"type":"node"}," can now be a ",{"attributes":{},"tag":"code","children":["NamedTuple/Tuple"],"type":"node"}," of models for use in custom training loops. Likewise, ",{"attributes":{},"tag":"code","children":["learner.params"],"type":"node"}," now resembles the structure of ",{"attributes":{},"tag":"code","children":["learner.model"],"type":"node"},", allowing separate access to parameters of different models."],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["Callbacks"],"type":"node"},{"attributes":{},"tag":"ul","children":[{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["Added ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.init!"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["init!"],"type":"node"}],"type":"node"}," method for callback initilization, replacing the ",{"attributes":{},"tag":"code","children":["Init"],"type":"node"}," event which required a ",{"attributes":{},"tag":"code","children":["Phase"],"type":"node"}," to implement."],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":[{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.Scheduler"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["Scheduler"],"type":"node"}],"type":"node"}," now has internal step counter and no longer relies on ",{"attributes":{},"tag":"code","children":["Recorder"],"type":"node"},"'s history. This makes it easier to replace the scheduler without needing to offset the new schedules."],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":[{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.EarlyStopping"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["EarlyStopping"],"type":"node"}],"type":"node"}," callback now uses criteria from ",{"attributes":{"href":"https://github.com/ablaom/EarlyStopping.jl","title":""},"tag":"a","children":["EarlyStopping.jl"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"h3","children":["Removed"],"type":"node"},{"attributes":{},"tag":"ul","children":[{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["Removed old training API. Methods ",{"attributes":{},"tag":"code","children":["fitbatch!"],"type":"node"},", ",{"attributes":{},"tag":"code","children":["fitbatchphase!"],"type":"node"},", ",{"attributes":{},"tag":"code","children":["fitepoch!"],"type":"node"},", ",{"attributes":{},"tag":"code","children":["fitepochphase!"],"type":"node"}," have all been removed."],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file diff --git a/data/FluxTraining@dev/doc/LICENSE.md.json b/data/FluxTraining@dev/doc/LICENSE.md.json index 61b903823..58d276174 100644 --- a/data/FluxTraining@dev/doc/LICENSE.md.json +++ b/data/FluxTraining@dev/doc/LICENSE.md.json @@ -1 +1 @@ -{"attributes":{"backlinks":[],"path":"/home/runner/.julia/packages/FluxTraining/xCOPx/LICENSE.md","title":"LICENSE"},"tag":"document","children":[{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"p","children":["MIT License"],"type":"node"},{"attributes":{},"tag":"p","children":["Copyright (c) 2020 lorenzoh ",{"attributes":{"href":"mailto:lorenz.ohly@gmail.com","title":"","document_id":"mailto:lorenz.ohly@gmail.com"},"tag":"reference","children":["lorenz.ohly@gmail.com"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"p","children":["Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:"],"type":"node"},{"attributes":{},"tag":"p","children":["The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software."],"type":"node"},{"attributes":{},"tag":"p","children":["THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE."],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file +{"attributes":{"backlinks":[],"path":"/home/runner/.julia/packages/FluxTraining/imTF4/LICENSE.md","title":"LICENSE"},"tag":"document","children":[{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"p","children":["MIT License"],"type":"node"},{"attributes":{},"tag":"p","children":["Copyright (c) 2020 lorenzoh ",{"attributes":{"href":"mailto:lorenz.ohly@gmail.com","title":"","document_id":"mailto:lorenz.ohly@gmail.com"},"tag":"reference","children":["lorenz.ohly@gmail.com"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"p","children":["Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:"],"type":"node"},{"attributes":{},"tag":"p","children":["The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software."],"type":"node"},{"attributes":{},"tag":"p","children":["THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE."],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file diff --git a/data/FluxTraining@dev/doc/README.md.json b/data/FluxTraining@dev/doc/README.md.json index d80c5cdc2..84a9e3c29 100644 --- a/data/FluxTraining@dev/doc/README.md.json +++ b/data/FluxTraining@dev/doc/README.md.json @@ -1 +1 @@ -{"attributes":{"backlinks":[],"path":"/home/runner/.julia/packages/FluxTraining/xCOPx/README.md","title":"FluxTraining.jl"},"tag":"document","children":[{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"h1","children":["FluxTraining.jl"],"type":"node"},{"attributes":{},"tag":"p","children":[{"attributes":{"href":"https://fluxml.ai/FluxTraining.jl/dev/i","title":""},"tag":"a","children":["Docs (master)"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"p","children":["A Julia package for using and writing powerful, extensible training loops for deep learning models."],"type":"node"},{"attributes":{},"tag":"h2","children":["What does it do?"],"type":"node"},{"attributes":{},"tag":"ul","children":[{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["Implements a training loop to take the boilerplate out of training deep learning models"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["Lets you add features to training loops through reusable ",{"attributes":{"href":"https://fluxml.ai/FluxTraining.jl/dev/documents/docs/callbacks/usage.md","title":""},"tag":"a","children":["callbacks"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["Comes with callbacks for many common use cases like ",{"attributes":{"href":"https://fluxml.ai/FluxTraining.jl/dev/documents/docs/tutorials/hyperparameters.md","title":""},"tag":"a","children":["hyperparameter scheduling"],"type":"node"},", ",{"attributes":{"href":"https://fluxml.ai/FluxTraining.jl/dev/references/FluxTraining.Metrics","title":""},"tag":"a","children":["metrics"],"type":"node"}," tracking and ",{"attributes":{"href":"https://fluxml.ai/FluxTraining.jl/dev/references/FluxTraining.LogMetrics","title":""},"tag":"a","children":["logging"],"type":"node"},", ",{"attributes":{"href":"https://fluxml.ai/FluxTraining.jl/dev/references/FluxTraining.Checkpointer","title":""},"tag":"a","children":["checkpointing"],"type":"node"},", ",{"attributes":{"href":"https://fluxml.ai/FluxTraining.jl/dev/references/FluxTraining.EarlyStopping","title":""},"tag":"a","children":["early stopping"],"type":"node"},", and ",{"attributes":{"href":"https://fluxml.ai/FluxTraining.jl/dev/documents/docs/callbacks/reference.md","title":""},"tag":"a","children":["more..."],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["Is extensible by creating ",{"attributes":{"href":"https://fluxml.ai/FluxTraining.jl/dev/documents/docs/callbacks/custom.md","title":""},"tag":"a","children":["custom, reusable callbacks"],"type":"node"}," or even ",{"attributes":{"href":"https://fluxml.ai/FluxTraining.jl/dev/documents/docs/tutorials/training.md","title":""},"tag":"a","children":["custom training loops"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"h2","children":["When should you use FluxTraining.jl?"],"type":"node"},{"attributes":{},"tag":"ul","children":[{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["You don't want to implement your own metrics tracking and hyperparameter scheduling or ",{"attributes":{},"tag":"em","children":["insert common training feature here"],"type":"node"}," for the 10th time"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["You want to use composable and reusable components that enhance your training loop"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["You want a simple training loop with reasonable defaults that can grow to the needs of your project"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"h3","children":["How do you use it?"],"type":"node"},{"attributes":{},"tag":"p","children":["Install like any other Julia package using the package manager:"],"type":"node"},{"attributes":{"lang":"julia-repl"},"tag":"codeblock","children":["]add FluxTraining\n"],"type":"node"},{"attributes":{},"tag":"p","children":["After installation, import it, create a ",{"attributes":{},"tag":"code","children":["Learner"],"type":"node"}," from a ",{"attributes":{"href":"https://github.com/FluxML/Flux.jl","title":""},"tag":"a","children":["Flux.jl"],"type":"node"}," model, data iterators, an optimizer, and a loss function. Finally train with ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.fit!"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["fit!"],"type":"node"}],"type":"node"},"."],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["FluxTraining"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Learner"},"tag":"reference","children":["Learner"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["lossfn"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.fit!"},"tag":"reference","children":["fit!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["10"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["trainiter"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["validiter"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"h2","children":["Next, you may want to read"],"type":"node"},{"attributes":{},"tag":"ul","children":[{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":[{"attributes":{"href":"docs/getting_started.md","title":"","document_id":"FluxTraining@dev/doc/docs/getting_started.md"},"tag":"reference","children":["Getting started"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":[{"attributes":{"href":"docs/tutorials/mnist.ipynb","title":"","document_id":"FluxTraining@dev/doc/docs/tutorials/mnist.ipynb"},"tag":"reference","children":["A full example training an image classifier on the MNIST dataset"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["The ",{"attributes":{"href":"https://fluxml.github.io/FastAI.jl/dev","title":""},"tag":"a","children":["documentation of FastAI.jl"],"type":"node"}," which features many end-to-end examples"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"h2","children":["Acknowledgements"],"type":"node"},{"attributes":{},"tag":"p","children":["The design of FluxTraining.jl's two-way callbacks is adapted from ",{"attributes":{"href":"https://docs.fast.ai","title":""},"tag":"a","children":["fastai"],"type":"node"},"'s training loop."],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file +{"attributes":{"backlinks":[],"path":"/home/runner/.julia/packages/FluxTraining/imTF4/README.md","title":"FluxTraining.jl"},"tag":"document","children":[{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"h1","children":["FluxTraining.jl"],"type":"node"},{"attributes":{},"tag":"p","children":[{"attributes":{"href":"https://fluxml.ai/FluxTraining.jl/dev/i","title":""},"tag":"a","children":["Docs (master)"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"p","children":["A Julia package for using and writing powerful, extensible training loops for deep learning models."],"type":"node"},{"attributes":{},"tag":"h2","children":["What does it do?"],"type":"node"},{"attributes":{},"tag":"ul","children":[{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["Implements a training loop to take the boilerplate out of training deep learning models"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["Lets you add features to training loops through reusable ",{"attributes":{"href":"https://fluxml.ai/FluxTraining.jl/dev/documents/docs/callbacks/usage.md","title":""},"tag":"a","children":["callbacks"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["Comes with callbacks for many common use cases like ",{"attributes":{"href":"https://fluxml.ai/FluxTraining.jl/dev/documents/docs/tutorials/hyperparameters.md","title":""},"tag":"a","children":["hyperparameter scheduling"],"type":"node"},", ",{"attributes":{"href":"https://fluxml.ai/FluxTraining.jl/dev/references/FluxTraining.Metrics","title":""},"tag":"a","children":["metrics"],"type":"node"}," tracking and ",{"attributes":{"href":"https://fluxml.ai/FluxTraining.jl/dev/references/FluxTraining.LogMetrics","title":""},"tag":"a","children":["logging"],"type":"node"},", ",{"attributes":{"href":"https://fluxml.ai/FluxTraining.jl/dev/references/FluxTraining.Checkpointer","title":""},"tag":"a","children":["checkpointing"],"type":"node"},", ",{"attributes":{"href":"https://fluxml.ai/FluxTraining.jl/dev/references/FluxTraining.EarlyStopping","title":""},"tag":"a","children":["early stopping"],"type":"node"},", and ",{"attributes":{"href":"https://fluxml.ai/FluxTraining.jl/dev/documents/docs/callbacks/reference.md","title":""},"tag":"a","children":["more..."],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["Is extensible by creating ",{"attributes":{"href":"https://fluxml.ai/FluxTraining.jl/dev/documents/docs/callbacks/custom.md","title":""},"tag":"a","children":["custom, reusable callbacks"],"type":"node"}," or even ",{"attributes":{"href":"https://fluxml.ai/FluxTraining.jl/dev/documents/docs/tutorials/training.md","title":""},"tag":"a","children":["custom training loops"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"h2","children":["When should you use FluxTraining.jl?"],"type":"node"},{"attributes":{},"tag":"ul","children":[{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["You don't want to implement your own metrics tracking and hyperparameter scheduling or ",{"attributes":{},"tag":"em","children":["insert common training feature here"],"type":"node"}," for the 10th time"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["You want to use composable and reusable components that enhance your training loop"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["You want a simple training loop with reasonable defaults that can grow to the needs of your project"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"h3","children":["How do you use it?"],"type":"node"},{"attributes":{},"tag":"p","children":["Install like any other Julia package using the package manager:"],"type":"node"},{"attributes":{"lang":"julia-repl"},"tag":"codeblock","children":["]add FluxTraining\n"],"type":"node"},{"attributes":{},"tag":"p","children":["After installation, import it, create a ",{"attributes":{},"tag":"code","children":["Learner"],"type":"node"}," from a ",{"attributes":{"href":"https://github.com/FluxML/Flux.jl","title":""},"tag":"a","children":["Flux.jl"],"type":"node"}," model, data iterators, an optimizer, and a loss function. Finally train with ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.fit!"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["fit!"],"type":"node"}],"type":"node"},"."],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["FluxTraining"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Learner"},"tag":"reference","children":["Learner"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["lossfn"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.fit!"},"tag":"reference","children":["fit!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["10"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["trainiter"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["validiter"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"h2","children":["Next, you may want to read"],"type":"node"},{"attributes":{},"tag":"ul","children":[{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":[{"attributes":{"href":"docs/getting_started.md","title":"","document_id":"FluxTraining@dev/doc/docs/getting_started.md"},"tag":"reference","children":["Getting started"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":[{"attributes":{"href":"docs/tutorials/mnist.ipynb","title":"","document_id":"FluxTraining@dev/doc/docs/tutorials/mnist.ipynb"},"tag":"reference","children":["A full example training an image classifier on the MNIST dataset"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["The ",{"attributes":{"href":"https://fluxml.github.io/FastAI.jl/dev","title":""},"tag":"a","children":["documentation of FastAI.jl"],"type":"node"}," which features many end-to-end examples"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"h2","children":["Acknowledgements"],"type":"node"},{"attributes":{},"tag":"p","children":["The design of FluxTraining.jl's two-way callbacks is adapted from ",{"attributes":{"href":"https://docs.fast.ai","title":""},"tag":"a","children":["fastai"],"type":"node"},"'s training loop."],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file diff --git a/data/FluxTraining@dev/doc/docs/background/dataiterator.md.json b/data/FluxTraining@dev/doc/docs/background/dataiterator.md.json index 81e378714..0da790704 100644 --- a/data/FluxTraining@dev/doc/docs/background/dataiterator.md.json +++ b/data/FluxTraining@dev/doc/docs/background/dataiterator.md.json @@ -1 +1 @@ -{"attributes":{"backlinks":[{"tag":"document","title":"Models","docid":"FluxTraining@dev/doc/docs/background/model.md"},{"tag":"document","title":"Getting started","docid":"FluxTraining@dev/doc/docs/getting_started.md"},{"tag":"document","title":"Loss functions","docid":"FluxTraining@dev/doc/docs/background/lossfunction.md"}],"path":"/home/runner/.julia/packages/FluxTraining/xCOPx/docs/background/dataiterator.md","title":"Data iterators"},"tag":"document","children":[{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"h1","children":["Data iterators"],"type":"node"},{"attributes":{},"tag":"p","children":["A data iterator is an iterator over batches of the data that is used for one step of fitting. You can use different data iterators with this package, as long as they have the following properties."],"type":"node"},{"attributes":{},"tag":"p","children":["Firstly, you must be able to iterate over a data iterator:"],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"for","children":[{"attributes":{},"tag":"for","children":["for"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["batch"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"in","children":["in"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["dataiter"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Comment","children":["# step"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"p","children":["The data iterator must also be compatible with the other components of the ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.Learner"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["Learner"],"type":"node"}],"type":"node"},". For the standard supervised learning step (",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.TrainingPhase"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["TrainingPhase"],"type":"node"}],"type":"node"}," and ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.ValidationPhase"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["ValidationPhase"],"type":"node"}],"type":"node"},"), this means"],"type":"node"},{"attributes":{},"tag":"ul","children":[{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":[{"attributes":{},"tag":"code","children":["batch"],"type":"node"}," is a tuple ",{"attributes":{},"tag":"code","children":["(xs, ys)"],"type":"node"}," of encoded inputs and targets,"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":[{"attributes":{},"tag":"code","children":["xs"],"type":"node"}," is a valid input to the ",{"attributes":{"href":"/doc/docs/background/model.md","title":"","document_id":"FluxTraining@dev/doc/docs/background/model.md"},"tag":"reference","children":["model"],"type":"node"},", so ",{"attributes":{},"tag":"code","children":["ŷs = model(xs)"],"type":"node"},"; and"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":[{"attributes":{},"tag":"code","children":["ys"],"type":"node"}," can be compared to the model output with the ",{"attributes":{"href":"/doc/docs/background/lossfunction.md","title":"","document_id":"FluxTraining@dev/doc/docs/background/lossfunction.md"},"tag":"reference","children":["loss function"],"type":"node"},", i.e. ",{"attributes":{},"tag":"code","children":["lossfn(ŷs, ys)"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"p","children":["If you are working with a ",{"attributes":{"href":"/doc/docs/tutorials/training.md","title":"","document_id":"FluxTraining@dev/doc/docs/tutorials/training.md"},"tag":"reference","children":["custom training loop"],"type":"node"},", you may need to satisfy additional or different properties."],"type":"node"},{"attributes":{},"tag":"h2","children":["Creating data iterators"],"type":"node"},{"attributes":{},"tag":"p","children":["The simplest data iterator is a vector of preloaded batches. This is what we're using in the ",{"attributes":{"href":"/doc/docs/tutorials/mnist.ipynb","title":"","document_id":"FluxTraining@dev/doc/docs/tutorials/mnist.ipynb"},"tag":"reference","children":["MNIST tutorial"],"type":"node"},". This is a fine approach for smaller datasets, but has some limitations."],"type":"node"},{"attributes":{},"tag":"p","children":["First of all, there is no principled way for doing things like splitting, subsetting and shuffling data. For this, we recommend using ",{"attributes":{"href":"https://github.com/JuliaML/MLDataPattern.jl","title":""},"tag":"a","children":["MLDataPattern.jl"],"type":"node"}," which provides this functionality and many more utilities for defining and working with datasets."],"type":"node"},{"attributes":{},"tag":"p","children":["Another issue is that of memory load: if the whole dataset is too large to be preloaded in to memory, we have to load individual batches during training. To do this in a way that doesn't slow down the training itself, we suggest using ",{"attributes":{"href":"https://github.com/lorenzoh/DataLoaders.jl","title":""},"tag":"a","children":["DataLoaders.jl"],"type":"node"},". DataLoaders.jl is compatible with MLDataPattern.jl and allows you to easily create efficient data iterators for out-of-memory datasets. The documentation of DataLoaders.jl also has a lot more information on working with large dataset for deep learning."],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file +{"attributes":{"backlinks":[{"tag":"document","title":"Models","docid":"FluxTraining@dev/doc/docs/background/model.md"},{"tag":"document","title":"Getting started","docid":"FluxTraining@dev/doc/docs/getting_started.md"},{"tag":"document","title":"Loss functions","docid":"FluxTraining@dev/doc/docs/background/lossfunction.md"}],"path":"/home/runner/.julia/packages/FluxTraining/imTF4/docs/background/dataiterator.md","title":"Data iterators"},"tag":"document","children":[{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"h1","children":["Data iterators"],"type":"node"},{"attributes":{},"tag":"p","children":["A data iterator is an iterator over batches of the data that is used for one step of fitting. You can use different data iterators with this package, as long as they have the following properties."],"type":"node"},{"attributes":{},"tag":"p","children":["Firstly, you must be able to iterate over a data iterator:"],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"for","children":[{"attributes":{},"tag":"for","children":["for"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["batch"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"in","children":["in"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["dataiter"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Comment","children":["# step"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"p","children":["The data iterator must also be compatible with the other components of the ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.Learner"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["Learner"],"type":"node"}],"type":"node"},". For the standard supervised learning step (",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.TrainingPhase"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["TrainingPhase"],"type":"node"}],"type":"node"}," and ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.ValidationPhase"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["ValidationPhase"],"type":"node"}],"type":"node"},"), this means"],"type":"node"},{"attributes":{},"tag":"ul","children":[{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":[{"attributes":{},"tag":"code","children":["batch"],"type":"node"}," is a tuple ",{"attributes":{},"tag":"code","children":["(xs, ys)"],"type":"node"}," of encoded inputs and targets,"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":[{"attributes":{},"tag":"code","children":["xs"],"type":"node"}," is a valid input to the ",{"attributes":{"href":"/doc/docs/background/model.md","title":"","document_id":"FluxTraining@dev/doc/docs/background/model.md"},"tag":"reference","children":["model"],"type":"node"},", so ",{"attributes":{},"tag":"code","children":["ŷs = model(xs)"],"type":"node"},"; and"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":[{"attributes":{},"tag":"code","children":["ys"],"type":"node"}," can be compared to the model output with the ",{"attributes":{"href":"/doc/docs/background/lossfunction.md","title":"","document_id":"FluxTraining@dev/doc/docs/background/lossfunction.md"},"tag":"reference","children":["loss function"],"type":"node"},", i.e. ",{"attributes":{},"tag":"code","children":["lossfn(ŷs, ys)"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"p","children":["If you are working with a ",{"attributes":{"href":"/doc/docs/tutorials/training.md","title":"","document_id":"FluxTraining@dev/doc/docs/tutorials/training.md"},"tag":"reference","children":["custom training loop"],"type":"node"},", you may need to satisfy additional or different properties."],"type":"node"},{"attributes":{},"tag":"h2","children":["Creating data iterators"],"type":"node"},{"attributes":{},"tag":"p","children":["The simplest data iterator is a vector of preloaded batches. This is what we're using in the ",{"attributes":{"href":"/doc/docs/tutorials/mnist.ipynb","title":"","document_id":"FluxTraining@dev/doc/docs/tutorials/mnist.ipynb"},"tag":"reference","children":["MNIST tutorial"],"type":"node"},". This is a fine approach for smaller datasets, but has some limitations."],"type":"node"},{"attributes":{},"tag":"p","children":["First of all, there is no principled way for doing things like splitting, subsetting and shuffling data. For this, we recommend using ",{"attributes":{"href":"https://github.com/JuliaML/MLDataPattern.jl","title":""},"tag":"a","children":["MLDataPattern.jl"],"type":"node"}," which provides this functionality and many more utilities for defining and working with datasets."],"type":"node"},{"attributes":{},"tag":"p","children":["Another issue is that of memory load: if the whole dataset is too large to be preloaded in to memory, we have to load individual batches during training. To do this in a way that doesn't slow down the training itself, we suggest using ",{"attributes":{"href":"https://github.com/lorenzoh/DataLoaders.jl","title":""},"tag":"a","children":["DataLoaders.jl"],"type":"node"},". DataLoaders.jl is compatible with MLDataPattern.jl and allows you to easily create efficient data iterators for out-of-memory datasets. The documentation of DataLoaders.jl also has a lot more information on working with large dataset for deep learning."],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file diff --git a/data/FluxTraining@dev/doc/docs/background/lossfunction.md.json b/data/FluxTraining@dev/doc/docs/background/lossfunction.md.json index 595621fc9..f0d8ac0e1 100644 --- a/data/FluxTraining@dev/doc/docs/background/lossfunction.md.json +++ b/data/FluxTraining@dev/doc/docs/background/lossfunction.md.json @@ -1 +1 @@ -{"attributes":{"backlinks":[{"tag":"document","title":"Getting started","docid":"FluxTraining@dev/doc/docs/getting_started.md"},{"tag":"document","title":"Data iterators","docid":"FluxTraining@dev/doc/docs/background/dataiterator.md"}],"path":"/home/runner/.julia/packages/FluxTraining/xCOPx/docs/background/lossfunction.md","title":"Loss functions"},"tag":"document","children":[{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"h1","children":["Loss functions"],"type":"node"},{"attributes":{},"tag":"p","children":["A loss function compares model outputs to true targets, resulting in a loss. For a loss function to be compatible with the standard supervised training loop, the following properties must hold."],"type":"node"},{"attributes":{},"tag":"p","children":["Firstly, the loss function should accept the model outputs and targets, and return a single scalar value. Given a ",{"attributes":{"href":"/doc/docs/background/dataiterator.md","title":"","document_id":"FluxTraining@dev/doc/docs/background/dataiterator.md"},"tag":"reference","children":["data iterator"],"type":"node"}," ",{"attributes":{},"tag":"code","children":["dataiter"],"type":"node"}," and a ",{"attributes":{"href":"/doc/docs/background/model.md","title":"","document_id":"FluxTraining@dev/doc/docs/background/model.md"},"tag":"reference","children":["model"],"type":"node"}," ",{"attributes":{},"tag":"code","children":["model"],"type":"node"},":"],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"Identifier","children":["xs"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ys"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["dataiter"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["ŷs"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["xs"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["lossfn"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ŷs"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ys"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"isa","children":["isa"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Number"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"p","children":["The loss function must also be differentiable, so that gradients can be calculated during training. See ",{"attributes":{"href":"/doc/docs/background/model.md","title":"","document_id":"FluxTraining@dev/doc/docs/background/model.md"},"tag":"reference","children":["models"],"type":"node"}," for more on how to check this."],"type":"node"},{"attributes":{},"tag":"h2","children":["Creating loss functions"],"type":"node"},{"attributes":{},"tag":"p","children":["Flux.jl comes with a lot of commonly used loss functions built-in in its submodule ",{"attributes":{},"tag":"code","children":["Flux.Losses"],"type":"node"},". See ",{"attributes":{"href":"https://fluxml.ai/Flux.jl/stable/models/losses/","title":""},"tag":"a","children":["Flux.jl loss functions"],"type":"node"}," for a complete reference."],"type":"node"},{"attributes":{},"tag":"p","children":["You can also write your own loss functions. If you are using non-mutating array operations, there is a good chance that it will be differentiable and also be compatible with GPU arrays from ",{"attributes":{"href":"https://github.com/JuliaGPU/CUDA.jl","title":""},"tag":"a","children":["CUDA.jl"],"type":"node"},"."],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file +{"attributes":{"backlinks":[{"tag":"document","title":"Getting started","docid":"FluxTraining@dev/doc/docs/getting_started.md"},{"tag":"document","title":"Data iterators","docid":"FluxTraining@dev/doc/docs/background/dataiterator.md"}],"path":"/home/runner/.julia/packages/FluxTraining/imTF4/docs/background/lossfunction.md","title":"Loss functions"},"tag":"document","children":[{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"h1","children":["Loss functions"],"type":"node"},{"attributes":{},"tag":"p","children":["A loss function compares model outputs to true targets, resulting in a loss. For a loss function to be compatible with the standard supervised training loop, the following properties must hold."],"type":"node"},{"attributes":{},"tag":"p","children":["Firstly, the loss function should accept the model outputs and targets, and return a single scalar value. Given a ",{"attributes":{"href":"/doc/docs/background/dataiterator.md","title":"","document_id":"FluxTraining@dev/doc/docs/background/dataiterator.md"},"tag":"reference","children":["data iterator"],"type":"node"}," ",{"attributes":{},"tag":"code","children":["dataiter"],"type":"node"}," and a ",{"attributes":{"href":"/doc/docs/background/model.md","title":"","document_id":"FluxTraining@dev/doc/docs/background/model.md"},"tag":"reference","children":["model"],"type":"node"}," ",{"attributes":{},"tag":"code","children":["model"],"type":"node"},":"],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"Identifier","children":["xs"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ys"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["dataiter"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["ŷs"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["xs"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["lossfn"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ŷs"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ys"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"isa","children":["isa"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Number"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"p","children":["The loss function must also be differentiable, so that gradients can be calculated during training. See ",{"attributes":{"href":"/doc/docs/background/model.md","title":"","document_id":"FluxTraining@dev/doc/docs/background/model.md"},"tag":"reference","children":["models"],"type":"node"}," for more on how to check this."],"type":"node"},{"attributes":{},"tag":"h2","children":["Creating loss functions"],"type":"node"},{"attributes":{},"tag":"p","children":["Flux.jl comes with a lot of commonly used loss functions built-in in its submodule ",{"attributes":{},"tag":"code","children":["Flux.Losses"],"type":"node"},". See ",{"attributes":{"href":"https://fluxml.ai/Flux.jl/stable/models/losses/","title":""},"tag":"a","children":["Flux.jl loss functions"],"type":"node"}," for a complete reference."],"type":"node"},{"attributes":{},"tag":"p","children":["You can also write your own loss functions. If you are using non-mutating array operations, there is a good chance that it will be differentiable and also be compatible with GPU arrays from ",{"attributes":{"href":"https://github.com/JuliaGPU/CUDA.jl","title":""},"tag":"a","children":["CUDA.jl"],"type":"node"},"."],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file diff --git a/data/FluxTraining@dev/doc/docs/background/model.md.json b/data/FluxTraining@dev/doc/docs/background/model.md.json index f18dc742c..e95a6a5fd 100644 --- a/data/FluxTraining@dev/doc/docs/background/model.md.json +++ b/data/FluxTraining@dev/doc/docs/background/model.md.json @@ -1 +1 @@ -{"attributes":{"backlinks":[{"tag":"document","title":"Optimizers","docid":"FluxTraining@dev/doc/docs/background/optimizer.md"},{"tag":"document","title":"Getting started","docid":"FluxTraining@dev/doc/docs/getting_started.md"},{"tag":"document","title":"Loss functions","docid":"FluxTraining@dev/doc/docs/background/lossfunction.md"},{"tag":"document","title":"Data iterators","docid":"FluxTraining@dev/doc/docs/background/dataiterator.md"}],"path":"/home/runner/.julia/packages/FluxTraining/xCOPx/docs/background/model.md","title":"Models"},"tag":"document","children":[{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"h1","children":["Models"],"type":"node"},{"attributes":{},"tag":"p","children":["FluxTraining.jl works with all ",{"attributes":{"href":"https://github.com/FluxML/Flux.jl","title":""},"tag":"a","children":["Flux.jl"],"type":"node"},"-compatible models. Unless you are using a ",{"attributes":{"href":"/doc/docs/tutorials/training.md","title":"","document_id":"FluxTraining@dev/doc/docs/tutorials/training.md"},"tag":"reference","children":["custom training loop"],"type":"node"},", a ",{"attributes":{},"tag":"code","children":["model"],"type":"node"}," is expected to take a single input ",{"attributes":{},"tag":"code","children":["xs"],"type":"node"},", which corresponds to the encoded inputs returned by your ",{"attributes":{"href":"/doc/docs/background/dataiterator.md","title":"","document_id":"FluxTraining@dev/doc/docs/background/dataiterator.md"},"tag":"reference","children":["data iterator"],"type":"node"},". This means the following has to work:"],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"Identifier","children":["xs"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ys"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["first"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["dataiter"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["ŷs"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["xs"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"p","children":[{"attributes":{},"tag":"code","children":["model"],"type":"node"}," also has to be differentiable. If you're composing Flux.jl layers, this is likely the case. You can always make sure by testing:"],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Flux"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Zygote"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"Identifier","children":["xs"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ys"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["first"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["dataiter"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["lossfn"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Flux"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["mse"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["grads"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"do","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Zygote"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["gradient"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Flux"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["params"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"do","children":["do"],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["lossfn"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["xs"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ys"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"h2","children":["Creating models"],"type":"node"},{"attributes":{},"tag":"p","children":["The simplest way to create a Flux.jl-compatible model is to use layers from Flux.jl. A good entrypoint is ",{"attributes":{"href":"https://fluxml.ai/Flux.jl/stable/models/basics/","title":""},"tag":"a","children":["this tutorial"],"type":"node"},"in Flux's documentation."],"type":"node"},{"attributes":{},"tag":"p","children":["There is also a large number of packages that provide complete model architectures or domain-specific layers. Below is a non-exhaustive list:"],"type":"node"},{"attributes":{},"tag":"ul","children":[{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":[{"attributes":{"href":"https://github.com/FluxML/Metalhead.jl","title":""},"tag":"a","children":["Metalhead.jl"],"type":"node"}," implements common model architectures for computer vision,"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":[{"attributes":{"href":"https://github.com/CarloLucibello/GraphNeuralNetworks.jl","title":""},"tag":"a","children":["GraphNeuralNetworks.jl"],"type":"node"}," provides layers and utilities for graph neural networks,"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":[{"attributes":{"href":"https://github.com/chengchingwen/Transformers.jl","title":""},"tag":"a","children":["Transformers.jl"],"type":"node"}," implements transformer models including pretrained language models"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file +{"attributes":{"backlinks":[{"tag":"document","title":"Optimizers","docid":"FluxTraining@dev/doc/docs/background/optimizer.md"},{"tag":"document","title":"Getting started","docid":"FluxTraining@dev/doc/docs/getting_started.md"},{"tag":"document","title":"Loss functions","docid":"FluxTraining@dev/doc/docs/background/lossfunction.md"},{"tag":"document","title":"Data iterators","docid":"FluxTraining@dev/doc/docs/background/dataiterator.md"}],"path":"/home/runner/.julia/packages/FluxTraining/imTF4/docs/background/model.md","title":"Models"},"tag":"document","children":[{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"h1","children":["Models"],"type":"node"},{"attributes":{},"tag":"p","children":["FluxTraining.jl works with all ",{"attributes":{"href":"https://github.com/FluxML/Flux.jl","title":""},"tag":"a","children":["Flux.jl"],"type":"node"},"-compatible models. Unless you are using a ",{"attributes":{"href":"/doc/docs/tutorials/training.md","title":"","document_id":"FluxTraining@dev/doc/docs/tutorials/training.md"},"tag":"reference","children":["custom training loop"],"type":"node"},", a ",{"attributes":{},"tag":"code","children":["model"],"type":"node"}," is expected to take a single input ",{"attributes":{},"tag":"code","children":["xs"],"type":"node"},", which corresponds to the encoded inputs returned by your ",{"attributes":{"href":"/doc/docs/background/dataiterator.md","title":"","document_id":"FluxTraining@dev/doc/docs/background/dataiterator.md"},"tag":"reference","children":["data iterator"],"type":"node"},". This means the following has to work:"],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"Identifier","children":["xs"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ys"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["first"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["dataiter"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["ŷs"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["xs"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"p","children":[{"attributes":{},"tag":"code","children":["model"],"type":"node"}," also has to be differentiable. If you're composing Flux.jl layers, this is likely the case. You can always make sure by testing:"],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Flux"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Zygote"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"Identifier","children":["xs"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ys"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["first"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["dataiter"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["lossfn"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Flux"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["mse"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["grads"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"do","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Zygote"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["gradient"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Flux"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["params"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"do","children":["do"],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["lossfn"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["xs"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ys"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"h2","children":["Creating models"],"type":"node"},{"attributes":{},"tag":"p","children":["The simplest way to create a Flux.jl-compatible model is to use layers from Flux.jl. A good entrypoint is ",{"attributes":{"href":"https://fluxml.ai/Flux.jl/stable/models/basics/","title":""},"tag":"a","children":["this tutorial"],"type":"node"},"in Flux's documentation."],"type":"node"},{"attributes":{},"tag":"p","children":["There is also a large number of packages that provide complete model architectures or domain-specific layers. Below is a non-exhaustive list:"],"type":"node"},{"attributes":{},"tag":"ul","children":[{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":[{"attributes":{"href":"https://github.com/FluxML/Metalhead.jl","title":""},"tag":"a","children":["Metalhead.jl"],"type":"node"}," implements common model architectures for computer vision,"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":[{"attributes":{"href":"https://github.com/CarloLucibello/GraphNeuralNetworks.jl","title":""},"tag":"a","children":["GraphNeuralNetworks.jl"],"type":"node"}," provides layers and utilities for graph neural networks,"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":[{"attributes":{"href":"https://github.com/chengchingwen/Transformers.jl","title":""},"tag":"a","children":["Transformers.jl"],"type":"node"}," implements transformer models including pretrained language models"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file diff --git a/data/FluxTraining@dev/doc/docs/background/optimizer.md.json b/data/FluxTraining@dev/doc/docs/background/optimizer.md.json index 2a755fb7d..a2867d9e4 100644 --- a/data/FluxTraining@dev/doc/docs/background/optimizer.md.json +++ b/data/FluxTraining@dev/doc/docs/background/optimizer.md.json @@ -1 +1 @@ -{"attributes":{"backlinks":[{"tag":"document","title":"Getting started","docid":"FluxTraining@dev/doc/docs/getting_started.md"}],"path":"/home/runner/.julia/packages/FluxTraining/xCOPx/docs/background/optimizer.md","title":"Optimizers"},"tag":"document","children":[{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"h1","children":["Optimizers"],"type":"node"},{"attributes":{},"tag":"p","children":["An optimizer takes the calculated gradients from a training step and uses them to update the parameters of a ",{"attributes":{"href":"/doc/docs/background/model.md","title":"","document_id":"FluxTraining@dev/doc/docs/background/model.md"},"tag":"reference","children":["model"],"type":"node"},". FluxTraining.jl currently only supports optimizers from ",{"attributes":{"href":"https://github.com/FluxML/Flux.jl","title":""},"tag":"a","children":["Flux.jl"],"type":"node"},"."],"type":"node"},{"attributes":{},"tag":"p","children":["A complete reference of optimizers in Flux.jl can be found ",{"attributes":{"href":"https://fluxml.ai/Flux.jl/stable/training/optimisers/","title":""},"tag":"a","children":["here"],"type":"node"},"."],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file +{"attributes":{"backlinks":[{"tag":"document","title":"Getting started","docid":"FluxTraining@dev/doc/docs/getting_started.md"}],"path":"/home/runner/.julia/packages/FluxTraining/imTF4/docs/background/optimizer.md","title":"Optimizers"},"tag":"document","children":[{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"h1","children":["Optimizers"],"type":"node"},{"attributes":{},"tag":"p","children":["An optimizer takes the calculated gradients from a training step and uses them to update the parameters of a ",{"attributes":{"href":"/doc/docs/background/model.md","title":"","document_id":"FluxTraining@dev/doc/docs/background/model.md"},"tag":"reference","children":["model"],"type":"node"},". FluxTraining.jl currently only supports optimizers from ",{"attributes":{"href":"https://github.com/FluxML/Flux.jl","title":""},"tag":"a","children":["Flux.jl"],"type":"node"},"."],"type":"node"},{"attributes":{},"tag":"p","children":["A complete reference of optimizers in Flux.jl can be found ",{"attributes":{"href":"https://fluxml.ai/Flux.jl/stable/training/optimisers/","title":""},"tag":"a","children":["here"],"type":"node"},"."],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file diff --git a/data/FluxTraining@dev/doc/docs/callbacks/custom.md.json b/data/FluxTraining@dev/doc/docs/callbacks/custom.md.json index 7c339d4cd..38a5703bd 100644 --- a/data/FluxTraining@dev/doc/docs/callbacks/custom.md.json +++ b/data/FluxTraining@dev/doc/docs/callbacks/custom.md.json @@ -1 +1 @@ -{"attributes":{"backlinks":[{"tag":"document","title":"Getting started","docid":"FluxTraining@dev/doc/docs/overview.md"},{"tag":"document","title":"Hyperparameter scheduling","docid":"FluxTraining@dev/doc/docs/tutorials/hyperparameters.md"},{"tag":"document","title":"Callback reference","docid":"FluxTraining@dev/doc/docs/callbacks/reference.md"},{"tag":"document","title":"How to use callbacks","docid":"FluxTraining@dev/doc/docs/callbacks/usage.md"}],"path":"/home/runner/.julia/packages/FluxTraining/xCOPx/docs/callbacks/custom.md","title":"Custom callbacks"},"tag":"document","children":[{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"h1","children":["Custom callbacks"],"type":"node"},{"attributes":{},"tag":"p","children":[{"attributes":{},"tag":"em","children":["FluxTraining.jl"],"type":"node"},"'s callback system is built around multiple dispatch, so you specify which part of the training you want to \"hook into\" by dispatching on ",{"attributes":{"href":"#","title":""},"tag":"a","children":[{"attributes":{},"tag":"code","children":["Phase"],"type":"node"}],"type":"node"},"s and ",{"attributes":{},"tag":"code","children":["Event"],"type":"node"},"s. See ",{"attributes":{"href":"/doc/docs/tutorials/training.md","title":"","document_id":"FluxTraining@dev/doc/docs/tutorials/training.md"},"tag":"reference","children":["Training loop"],"type":"node"}," and ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.Events"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["Events"],"type":"node"}],"type":"node"}," as a reference to phases and events."],"type":"node"},{"attributes":{},"tag":"h2","children":["A guided example"],"type":"node"},{"attributes":{},"tag":"p","children":["There are 4 things you need to do to implement a custom callback:"],"type":"node"},{"attributes":{},"tag":"ol","children":[{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["Create a callback ",{"attributes":{},"tag":"code","children":["struct"],"type":"node"}," that subtypes ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.Callback"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["Callback"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["Write event handlers with ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.on"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["on"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["Define what state the callback accesses by implementing ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.stateaccess"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["stateaccess"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["(Optionally) define dependencies on other callbacks with ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.runafter"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["runafter"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"p","children":["Let's go through them one at a time by implementing a simple callback that prints something after every batch."],"type":"node"},{"attributes":{},"tag":"h3","children":["Callback ",{"attributes":{},"tag":"code","children":["struct"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"p","children":["A callback definition has to subtype the abstract ",{"attributes":{},"tag":"code","children":["Callback"],"type":"node"}," type. It can include fields to use as internal state, but we don't need that here."],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Printer"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Callback"},"tag":"reference","children":["Callback"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"h3","children":["Event handlers"],"type":"node"},{"attributes":{},"tag":"p","children":["Now we need to add an event handler so that ",{"attributes":{},"tag":"code","children":["Printer"],"type":"node"}," can run some code when a step ends. Event handlers can be defined by adding a method to ",{"attributes":{},"tag":"code","children":["FluxTraining.on"],"type":"node"},". It takes as arguments an ",{"attributes":{"href":"#","title":""},"tag":"a","children":[{"attributes":{},"tag":"code","children":["Event"],"type":"node"}],"type":"node"},", a ",{"attributes":{"href":"#","title":""},"tag":"a","children":[{"attributes":{},"tag":"code","children":["Phase"],"type":"node"}],"type":"node"},", the callback and the learner:"],"type":"node"},{"attributes":{},"tag":"p","children":[{"attributes":{},"tag":"code","children":["on(event::Event, phase::Phase, callback::Callback, learner)"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"p","children":["The ",{"attributes":{},"tag":"code","children":["event"],"type":"node"},", ",{"attributes":{},"tag":"code","children":["phase"],"type":"node"}," and ",{"attributes":{},"tag":"code","children":["callback"],"type":"node"}," are used to dispatch."],"type":"node"},{"attributes":{},"tag":"p","children":["In this case, we want to run code at the end of a step, so the event we need to dispatch on is ",{"attributes":{"href":"#","title":""},"tag":"a","children":[{"attributes":{},"tag":"code","children":["StepEnd"],"type":"node"}],"type":"node"},". We want it to run in any phase, so we use the abstract type ",{"attributes":{},"tag":"code","children":["Phase"],"type":"node"},". The third argument type is the callback we want to add an event handler to. This gives us:"],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["FluxTraining"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.on"},"tag":"reference","children":["on"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["event"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["StepEnd"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Phase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["printer"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Printer"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["println"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Hello, World!"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"p","children":["We can now pass an instance of ",{"attributes":{},"tag":"code","children":["Printer"],"type":"node"}," when creating a ",{"attributes":{},"tag":"code","children":["Learner"],"type":"node"}," and the message will be printed at the end of every step."],"type":"node"},{"attributes":{},"tag":"h3","children":["State"],"type":"node"},{"attributes":{},"tag":"p","children":["As seen above, the callback handler ",{"attributes":{},"tag":"code","children":["on"],"type":"node"}," receives as the last argument a ",{"attributes":{},"tag":"code","children":["Learner"],"type":"node"}," instance, allowing the callback to access and modify state. If we wanted to print the last step's loss instead of a generic message, we could update our definition of ",{"attributes":{},"tag":"code","children":["on"],"type":"node"},":"],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["FluxTraining"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.on"},"tag":"reference","children":["on"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["event"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["EpochEnd"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Phase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["printer"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Printer"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["println"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Step loss:"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["step"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["loss"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"p","children":[{"attributes":{},"tag":"em","children":["(see ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.Learner"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["Learner"],"type":"node"}],"type":"node"}," for in-depth documentation of the ",{"attributes":{},"tag":"code","children":["Learner"],"type":"node"},"'s state)"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"p","children":["The ability to modify any state is very powerful, but it can quickly become problematic when it is unclear which callbacks modify what state and what the correct order should be. Because of that, ",{"attributes":{},"tag":"em","children":["FluxTraining.jl"],"type":"node"}," prevents callbacks from reading and modifying state by default. If we tried to use the above redefinition of ",{"attributes":{},"tag":"code","children":["on"],"type":"node"},", we would get the following error:"],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["FluxTraining"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ProtectedException"},"tag":"reference","children":["ProtectedException"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Read access to Learner.step.loss disallowed."],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"p","children":["To fix that error, we need to implement ",{"attributes":{},"tag":"code","children":["stateaccess"],"type":"node"},", a function that specifies what state a callback is allowed to read and write. In our case, we want to read the loss of the current step:"],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["FluxTraining"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.stateaccess"},"tag":"reference","children":["stateaccess"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Printer"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["step"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["loss"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Read"},"tag":"reference","children":["Read"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"p","children":[{"attributes":{},"tag":"em","children":["(see ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.stateaccess"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["stateaccess"],"type":"node"}],"type":"node"}," for more information on how to implement it)"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"p","children":["After that definition, the above code will run fine. This might seem bothersome, but this extra information makes it possible to analyze state dependencies before any code is run and saves you from running into nasty, hard-to-find bugs that can occur when using many callbacks together."],"type":"node"},{"attributes":{},"tag":"h3","children":["Dependencies"],"type":"node"},{"attributes":{},"tag":"p","children":["Let's improve our callback a bit by adding the current step number to the printed message, so it will look like this: ",{"attributes":{},"tag":"code","children":["\"Step 14 loss: 0.0032\""],"type":"node"},". For that we need to know what the current number of steps is. One way to go about this is to add a field to ",{"attributes":{},"tag":"code","children":["Printer"],"type":"node"}," that starts at ",{"attributes":{},"tag":"code","children":["0"],"type":"node"}," and is incremented every step. Luckily, there already is a callback that tracks this kind of statistics, the ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.Recorder"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["Recorder"],"type":"node"}],"type":"node"},". It uses a special piece of state, ",{"attributes":{},"tag":"code","children":["learner.cbstate"],"type":"node"},", to store a ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.History"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["History"],"type":"node"}],"type":"node"}," with this information."],"type":"node"},{"attributes":{"class":"info"},"tag":"admonition","children":[{"attributes":{},"tag":"admonitiontitle","children":["Callback state"],"type":"node"},{"attributes":{},"tag":"admonitionbody","children":[{"attributes":{},"tag":"p","children":[{"attributes":{},"tag":"code","children":["learner.cbstate"],"type":"node"}," is an object where callbacks can store state that they want to make available to other callbacks. Like any other piece of state, the callback writing to it needs to add a ",{"attributes":{},"tag":"code","children":["Write()"],"type":"node"}," permission to it using ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.stateaccess"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["stateaccess"],"type":"node"}],"type":"node"},"."],"type":"node"},{"attributes":{},"tag":"p","children":["What makes ",{"attributes":{},"tag":"code","children":["cbstate"],"type":"node"}," special is that when creating the callback graph, it is checked that every entry in ",{"attributes":{},"tag":"code","children":["cbstate"],"type":"node"}," that is accessed is being created first."],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"p","children":["The update to the event handler looks like this:"],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":["function FluxTraining.on(\n event::EpochEnd,\n phase::Phase,\n printer::Printer,\n learner)\n step = learner.cbstate.history[phase].stepsepoch # steps completed in current epoch\n println(\"Step \", , \" loss:\", learner.step.loss)\nend"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"p","children":["We also need to update the definition of ",{"attributes":{},"tag":"code","children":["stateaccess"],"type":"node"}," now:"],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["FluxTraining"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.stateaccess"},"tag":"reference","children":["stateaccess"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Printer"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["step"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["loss"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Read"},"tag":"reference","children":["Read"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Read"},"tag":"reference","children":["Read"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"p","children":["Since ",{"attributes":{},"tag":"code","children":["Printer"],"type":"node"}," depends on ",{"attributes":{},"tag":"code","children":["Recorder"],"type":"node"}," now, an error will be thrown if you try to use ",{"attributes":{},"tag":"code","children":["Printer"],"type":"node"}," without ",{"attributes":{},"tag":"code","children":["Recorder"],"type":"node"},". And that's it, pass ",{"attributes":{},"tag":"code","children":["Printer"],"type":"node"}," to a ",{"attributes":{},"tag":"code","children":["Learner"],"type":"node"}," and test it out! The upside of jumping through some additional hoops is that using the callback in the wrong context will always result in an error, so the user can have peace of mind."],"type":"node"},{"attributes":{},"tag":"h2","children":["Conflict resolution"],"type":"node"},{"attributes":{},"tag":"p","children":["When creating a ",{"attributes":{},"tag":"code","children":["Learner"],"type":"node"},", a dependency graph is created. The graph is then analyzed to find possible conflicts (for example, when two callbacks update the same state). Conflicts are detected automatically and will result in an error. Conflicts happen when the same state is being modified by multiple callbacks and it is unclear which order of running them (if any) is valid."],"type":"node"},{"attributes":{},"tag":"h3","children":["Resolving conflicts"],"type":"node"},{"attributes":{},"tag":"p","children":["There are two methods for resolving conflicts, ",{"attributes":{},"tag":"code","children":["runafter"],"type":"node"}," and ",{"attributes":{},"tag":"code","children":["resolveconflict"],"type":"node"},". ",{"attributes":{},"tag":"code","children":["runafter"],"type":"node"}," allows you to define list of callbacks that should run before the callback. For example, ",{"attributes":{},"tag":"code","children":["Recorder"],"type":"node"}," needs to run after all metrics:"],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["FluxTraining"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.runafter"},"tag":"reference","children":["runafter"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Recorder"},"tag":"reference","children":["Recorder"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.AbstractMetric"},"tag":"reference","children":["AbstractMetric"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"p","children":[{"attributes":{},"tag":"code","children":["resolveconflict"],"type":"node"}," provides more granular control to handle a possible conflict between two callbacks. It takes two callbacks and defines how to resolve a conflict:"],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"Comment","children":["# the default, errors with a helpful message"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.resolveconflict"},"tag":"reference","children":["resolveconflict"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["C1"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["C2"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["NotImplemented"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":[" \n"],"type":"node"},{"attributes":{},"tag":"Comment","children":["# two callbacks can never be used together:"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.resolveconflict"},"tag":"reference","children":["resolveconflict"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["C1"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["C2"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Unresolvable"},"tag":"reference","children":["Unresolvable"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":[" \n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.resolveconflict"},"tag":"reference","children":["resolveconflict"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["C1"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["C2"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.NoConflict"},"tag":"reference","children":["NoConflict"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Comment","children":["# there is no conflict, any run order is fine"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.resolveconflict"},"tag":"reference","children":["resolveconflict"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["cb1"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["C1"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["cb2"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["C2"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.RunFirst"},"tag":"reference","children":["RunFirst"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb1"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Comment","children":["# `cb1` must run before `cb2`."],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Comment","children":["# Equivalent to `runafter(::C2) = (C1,)"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"h2","children":["Callback execution"],"type":"node"},{"attributes":{},"tag":"p","children":["By default, a topological ordering of the callbacks is created from the dependency graph and the callbacks are executed serially. This behavior can be overwritten with custom callback executors, for example to create a ",{"attributes":{},"tag":"em","children":["Dagger.jl"],"type":"node"}," node from the graph to allow callbacks to safely run in parallel where valid."],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file +{"attributes":{"backlinks":[{"tag":"document","title":"Getting started","docid":"FluxTraining@dev/doc/docs/overview.md"},{"tag":"document","title":"Hyperparameter scheduling","docid":"FluxTraining@dev/doc/docs/tutorials/hyperparameters.md"},{"tag":"document","title":"Callback reference","docid":"FluxTraining@dev/doc/docs/callbacks/reference.md"},{"tag":"document","title":"How to use callbacks","docid":"FluxTraining@dev/doc/docs/callbacks/usage.md"}],"path":"/home/runner/.julia/packages/FluxTraining/imTF4/docs/callbacks/custom.md","title":"Custom callbacks"},"tag":"document","children":[{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"h1","children":["Custom callbacks"],"type":"node"},{"attributes":{},"tag":"p","children":[{"attributes":{},"tag":"em","children":["FluxTraining.jl"],"type":"node"},"'s callback system is built around multiple dispatch, so you specify which part of the training you want to \"hook into\" by dispatching on ",{"attributes":{"href":"#","title":""},"tag":"a","children":[{"attributes":{},"tag":"code","children":["Phase"],"type":"node"}],"type":"node"},"s and ",{"attributes":{},"tag":"code","children":["Event"],"type":"node"},"s. See ",{"attributes":{"href":"/doc/docs/tutorials/training.md","title":"","document_id":"FluxTraining@dev/doc/docs/tutorials/training.md"},"tag":"reference","children":["Training loop"],"type":"node"}," and ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.Events"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["Events"],"type":"node"}],"type":"node"}," as a reference to phases and events."],"type":"node"},{"attributes":{},"tag":"h2","children":["A guided example"],"type":"node"},{"attributes":{},"tag":"p","children":["There are 4 things you need to do to implement a custom callback:"],"type":"node"},{"attributes":{},"tag":"ol","children":[{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["Create a callback ",{"attributes":{},"tag":"code","children":["struct"],"type":"node"}," that subtypes ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.Callback"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["Callback"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["Write event handlers with ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.on"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["on"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["Define what state the callback accesses by implementing ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.stateaccess"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["stateaccess"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["(Optionally) define dependencies on other callbacks with ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.runafter"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["runafter"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"p","children":["Let's go through them one at a time by implementing a simple callback that prints something after every batch."],"type":"node"},{"attributes":{},"tag":"h3","children":["Callback ",{"attributes":{},"tag":"code","children":["struct"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"p","children":["A callback definition has to subtype the abstract ",{"attributes":{},"tag":"code","children":["Callback"],"type":"node"}," type. It can include fields to use as internal state, but we don't need that here."],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Printer"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Callback"},"tag":"reference","children":["Callback"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"h3","children":["Event handlers"],"type":"node"},{"attributes":{},"tag":"p","children":["Now we need to add an event handler so that ",{"attributes":{},"tag":"code","children":["Printer"],"type":"node"}," can run some code when a step ends. Event handlers can be defined by adding a method to ",{"attributes":{},"tag":"code","children":["FluxTraining.on"],"type":"node"},". It takes as arguments an ",{"attributes":{"href":"#","title":""},"tag":"a","children":[{"attributes":{},"tag":"code","children":["Event"],"type":"node"}],"type":"node"},", a ",{"attributes":{"href":"#","title":""},"tag":"a","children":[{"attributes":{},"tag":"code","children":["Phase"],"type":"node"}],"type":"node"},", the callback and the learner:"],"type":"node"},{"attributes":{},"tag":"p","children":[{"attributes":{},"tag":"code","children":["on(event::Event, phase::Phase, callback::Callback, learner)"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"p","children":["The ",{"attributes":{},"tag":"code","children":["event"],"type":"node"},", ",{"attributes":{},"tag":"code","children":["phase"],"type":"node"}," and ",{"attributes":{},"tag":"code","children":["callback"],"type":"node"}," are used to dispatch."],"type":"node"},{"attributes":{},"tag":"p","children":["In this case, we want to run code at the end of a step, so the event we need to dispatch on is ",{"attributes":{"href":"#","title":""},"tag":"a","children":[{"attributes":{},"tag":"code","children":["StepEnd"],"type":"node"}],"type":"node"},". We want it to run in any phase, so we use the abstract type ",{"attributes":{},"tag":"code","children":["Phase"],"type":"node"},". The third argument type is the callback we want to add an event handler to. This gives us:"],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["FluxTraining"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.on"},"tag":"reference","children":["on"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["event"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["StepEnd"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Phase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["printer"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Printer"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["println"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Hello, World!"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"p","children":["We can now pass an instance of ",{"attributes":{},"tag":"code","children":["Printer"],"type":"node"}," when creating a ",{"attributes":{},"tag":"code","children":["Learner"],"type":"node"}," and the message will be printed at the end of every step."],"type":"node"},{"attributes":{},"tag":"h3","children":["State"],"type":"node"},{"attributes":{},"tag":"p","children":["As seen above, the callback handler ",{"attributes":{},"tag":"code","children":["on"],"type":"node"}," receives as the last argument a ",{"attributes":{},"tag":"code","children":["Learner"],"type":"node"}," instance, allowing the callback to access and modify state. If we wanted to print the last step's loss instead of a generic message, we could update our definition of ",{"attributes":{},"tag":"code","children":["on"],"type":"node"},":"],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["FluxTraining"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.on"},"tag":"reference","children":["on"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["event"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["EpochEnd"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Phase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["printer"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Printer"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["println"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Step loss:"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["step"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["loss"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"p","children":[{"attributes":{},"tag":"em","children":["(see ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.Learner"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["Learner"],"type":"node"}],"type":"node"}," for in-depth documentation of the ",{"attributes":{},"tag":"code","children":["Learner"],"type":"node"},"'s state)"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"p","children":["The ability to modify any state is very powerful, but it can quickly become problematic when it is unclear which callbacks modify what state and what the correct order should be. Because of that, ",{"attributes":{},"tag":"em","children":["FluxTraining.jl"],"type":"node"}," prevents callbacks from reading and modifying state by default. If we tried to use the above redefinition of ",{"attributes":{},"tag":"code","children":["on"],"type":"node"},", we would get the following error:"],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["FluxTraining"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ProtectedException"},"tag":"reference","children":["ProtectedException"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Read access to Learner.step.loss disallowed."],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"p","children":["To fix that error, we need to implement ",{"attributes":{},"tag":"code","children":["stateaccess"],"type":"node"},", a function that specifies what state a callback is allowed to read and write. In our case, we want to read the loss of the current step:"],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["FluxTraining"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.stateaccess"},"tag":"reference","children":["stateaccess"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Printer"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["step"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["loss"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Read"},"tag":"reference","children":["Read"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"p","children":[{"attributes":{},"tag":"em","children":["(see ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.stateaccess"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["stateaccess"],"type":"node"}],"type":"node"}," for more information on how to implement it)"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"p","children":["After that definition, the above code will run fine. This might seem bothersome, but this extra information makes it possible to analyze state dependencies before any code is run and saves you from running into nasty, hard-to-find bugs that can occur when using many callbacks together."],"type":"node"},{"attributes":{},"tag":"h3","children":["Dependencies"],"type":"node"},{"attributes":{},"tag":"p","children":["Let's improve our callback a bit by adding the current step number to the printed message, so it will look like this: ",{"attributes":{},"tag":"code","children":["\"Step 14 loss: 0.0032\""],"type":"node"},". For that we need to know what the current number of steps is. One way to go about this is to add a field to ",{"attributes":{},"tag":"code","children":["Printer"],"type":"node"}," that starts at ",{"attributes":{},"tag":"code","children":["0"],"type":"node"}," and is incremented every step. Luckily, there already is a callback that tracks this kind of statistics, the ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.Recorder"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["Recorder"],"type":"node"}],"type":"node"},". It uses a special piece of state, ",{"attributes":{},"tag":"code","children":["learner.cbstate"],"type":"node"},", to store a ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.History"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["History"],"type":"node"}],"type":"node"}," with this information."],"type":"node"},{"attributes":{"class":"info"},"tag":"admonition","children":[{"attributes":{},"tag":"admonitiontitle","children":["Callback state"],"type":"node"},{"attributes":{},"tag":"admonitionbody","children":[{"attributes":{},"tag":"p","children":[{"attributes":{},"tag":"code","children":["learner.cbstate"],"type":"node"}," is an object where callbacks can store state that they want to make available to other callbacks. Like any other piece of state, the callback writing to it needs to add a ",{"attributes":{},"tag":"code","children":["Write()"],"type":"node"}," permission to it using ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.stateaccess"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["stateaccess"],"type":"node"}],"type":"node"},"."],"type":"node"},{"attributes":{},"tag":"p","children":["What makes ",{"attributes":{},"tag":"code","children":["cbstate"],"type":"node"}," special is that when creating the callback graph, it is checked that every entry in ",{"attributes":{},"tag":"code","children":["cbstate"],"type":"node"}," that is accessed is being created first."],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"p","children":["The update to the event handler looks like this:"],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":["function FluxTraining.on(\n event::EpochEnd,\n phase::Phase,\n printer::Printer,\n learner)\n step = learner.cbstate.history[phase].stepsepoch # steps completed in current epoch\n println(\"Step \", , \" loss:\", learner.step.loss)\nend"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"p","children":["We also need to update the definition of ",{"attributes":{},"tag":"code","children":["stateaccess"],"type":"node"}," now:"],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["FluxTraining"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.stateaccess"},"tag":"reference","children":["stateaccess"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Printer"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["step"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["loss"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Read"},"tag":"reference","children":["Read"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Read"},"tag":"reference","children":["Read"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"p","children":["Since ",{"attributes":{},"tag":"code","children":["Printer"],"type":"node"}," depends on ",{"attributes":{},"tag":"code","children":["Recorder"],"type":"node"}," now, an error will be thrown if you try to use ",{"attributes":{},"tag":"code","children":["Printer"],"type":"node"}," without ",{"attributes":{},"tag":"code","children":["Recorder"],"type":"node"},". And that's it, pass ",{"attributes":{},"tag":"code","children":["Printer"],"type":"node"}," to a ",{"attributes":{},"tag":"code","children":["Learner"],"type":"node"}," and test it out! The upside of jumping through some additional hoops is that using the callback in the wrong context will always result in an error, so the user can have peace of mind."],"type":"node"},{"attributes":{},"tag":"h2","children":["Conflict resolution"],"type":"node"},{"attributes":{},"tag":"p","children":["When creating a ",{"attributes":{},"tag":"code","children":["Learner"],"type":"node"},", a dependency graph is created. The graph is then analyzed to find possible conflicts (for example, when two callbacks update the same state). Conflicts are detected automatically and will result in an error. Conflicts happen when the same state is being modified by multiple callbacks and it is unclear which order of running them (if any) is valid."],"type":"node"},{"attributes":{},"tag":"h3","children":["Resolving conflicts"],"type":"node"},{"attributes":{},"tag":"p","children":["There are two methods for resolving conflicts, ",{"attributes":{},"tag":"code","children":["runafter"],"type":"node"}," and ",{"attributes":{},"tag":"code","children":["resolveconflict"],"type":"node"},". ",{"attributes":{},"tag":"code","children":["runafter"],"type":"node"}," allows you to define list of callbacks that should run before the callback. For example, ",{"attributes":{},"tag":"code","children":["Recorder"],"type":"node"}," needs to run after all metrics:"],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["FluxTraining"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.runafter"},"tag":"reference","children":["runafter"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Recorder"},"tag":"reference","children":["Recorder"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.AbstractMetric"},"tag":"reference","children":["AbstractMetric"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"p","children":[{"attributes":{},"tag":"code","children":["resolveconflict"],"type":"node"}," provides more granular control to handle a possible conflict between two callbacks. It takes two callbacks and defines how to resolve a conflict:"],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"Comment","children":["# the default, errors with a helpful message"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.resolveconflict"},"tag":"reference","children":["resolveconflict"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["C1"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["C2"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["NotImplemented"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":[" \n"],"type":"node"},{"attributes":{},"tag":"Comment","children":["# two callbacks can never be used together:"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.resolveconflict"},"tag":"reference","children":["resolveconflict"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["C1"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["C2"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Unresolvable"},"tag":"reference","children":["Unresolvable"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":[" \n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.resolveconflict"},"tag":"reference","children":["resolveconflict"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["C1"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["C2"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.NoConflict"},"tag":"reference","children":["NoConflict"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Comment","children":["# there is no conflict, any run order is fine"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.resolveconflict"},"tag":"reference","children":["resolveconflict"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["cb1"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["C1"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["cb2"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["C2"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.RunFirst"},"tag":"reference","children":["RunFirst"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb1"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Comment","children":["# `cb1` must run before `cb2`."],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Comment","children":["# Equivalent to `runafter(::C2) = (C1,)"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"h2","children":["Callback execution"],"type":"node"},{"attributes":{},"tag":"p","children":["By default, a topological ordering of the callbacks is created from the dependency graph and the callbacks are executed serially. This behavior can be overwritten with custom callback executors, for example to create a ",{"attributes":{},"tag":"em","children":["Dagger.jl"],"type":"node"}," node from the graph to allow callbacks to safely run in parallel where valid."],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file diff --git a/data/FluxTraining@dev/doc/docs/callbacks/reference.md.json b/data/FluxTraining@dev/doc/docs/callbacks/reference.md.json index da9a59a14..1d58be8ff 100644 --- a/data/FluxTraining@dev/doc/docs/callbacks/reference.md.json +++ b/data/FluxTraining@dev/doc/docs/callbacks/reference.md.json @@ -1 +1 @@ -{"attributes":{"backlinks":[{"tag":"document","title":"Getting started","docid":"FluxTraining@dev/doc/docs/overview.md"},{"tag":"document","title":"Training loop","docid":"FluxTraining@dev/doc/docs/tutorials/training.md"},{"tag":"document","title":"Training an image classifier","docid":"FluxTraining@dev/doc/docs/tutorials/mnist.ipynb"},{"tag":"document","title":"News","docid":"FluxTraining@dev/doc/CHANGELOG.md"},{"tag":"document","title":"How to use callbacks","docid":"FluxTraining@dev/doc/docs/callbacks/usage.md"}],"path":"/home/runner/.julia/packages/FluxTraining/xCOPx/docs/callbacks/reference.md","title":"Callback reference"},"tag":"document","children":[{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"h1","children":["Callback reference"],"type":"node"},{"attributes":{},"tag":"h2","children":["Included callbacks"],"type":"node"},{"attributes":{},"tag":"p","children":[{"attributes":{},"tag":"em","children":["FluxTraining.jl"],"type":"node"}," comes with many callbacks included. Some of them are added to ",{"attributes":{},"tag":"code","children":["Learner"],"type":"node"}," by default, here marked with a *."],"type":"node"},{"attributes":{"align":["left","left"]},"tag":"table","children":[{"attributes":{},"tag":"tr","children":[{"attributes":{},"tag":"th","children":["",{"attributes":{},"tag":"strong","children":["Callback"],"type":"node"},""],"type":"node"},{"attributes":{},"tag":"th","children":["",{"attributes":{},"tag":"strong","children":["Description"],"type":"node"},""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"tr","children":[{"attributes":{},"tag":"td","children":["",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.Metrics"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["Metrics"],"type":"node"}],"type":"node"},"*"],"type":"node"},{"attributes":{},"tag":"td","children":["Tracks loss and additional metrics on a per-step and per-epoch base"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"tr","children":[{"attributes":{},"tag":"td","children":["",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.Recorder"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["Recorder"],"type":"node"}],"type":"node"},"*"],"type":"node"},{"attributes":{},"tag":"td","children":["Records training stats like number of steps and epochs"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"tr","children":[{"attributes":{},"tag":"td","children":["",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.ProgressPrinter"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["ProgressPrinter"],"type":"node"}],"type":"node"},"*"],"type":"node"},{"attributes":{},"tag":"td","children":["Prints a progress bar for the current epoch during training"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"tr","children":[{"attributes":{},"tag":"td","children":["",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.MetricsPrinter"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["MetricsPrinter"],"type":"node"}],"type":"node"},"*"],"type":"node"},{"attributes":{},"tag":"td","children":["Prints out metrics after every epoch"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"tr","children":[{"attributes":{},"tag":"td","children":["",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.StopOnNaNLoss"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["StopOnNaNLoss"],"type":"node"}],"type":"node"},"*"],"type":"node"},{"attributes":{},"tag":"td","children":["Stops training early if a step loss is ",{"attributes":{},"tag":"code","children":["NaN"],"type":"node"},""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"tr","children":[{"attributes":{},"tag":"td","children":["",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.SanityCheck"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["SanityCheck"],"type":"node"}],"type":"node"},""],"type":"node"},{"attributes":{},"tag":"td","children":["Performs sanity checks on data, model and loss before training"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"tr","children":[{"attributes":{},"tag":"td","children":["",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.ToGPU"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["ToGPU"],"type":"node"}],"type":"node"},""],"type":"node"},{"attributes":{},"tag":"td","children":["Trains using a CUDA GPU if available"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"tr","children":[{"attributes":{},"tag":"td","children":["",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.Checkpointer"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["Checkpointer"],"type":"node"}],"type":"node"},""],"type":"node"},{"attributes":{},"tag":"td","children":["Saves the model after every epoch"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"tr","children":[{"attributes":{},"tag":"td","children":["",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.EarlyStopping"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["EarlyStopping"],"type":"node"}],"type":"node"},""],"type":"node"},{"attributes":{},"tag":"td","children":["Stops training early when a criterion is met"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"tr","children":[{"attributes":{},"tag":"td","children":["",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.Scheduler"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["Scheduler"],"type":"node"}],"type":"node"},""],"type":"node"},{"attributes":{},"tag":"td","children":["Schedules hyperparameters"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"tr","children":[{"attributes":{},"tag":"td","children":["",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.LogMetrics"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["LogMetrics"],"type":"node"}],"type":"node"},""],"type":"node"},{"attributes":{},"tag":"td","children":["Logs metrics to a logging backend"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"tr","children":[{"attributes":{},"tag":"td","children":["",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.LogHyperParams"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["LogHyperParams"],"type":"node"}],"type":"node"},""],"type":"node"},{"attributes":{},"tag":"td","children":["Logs hyperparameters to a logging backend"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"tr","children":[{"attributes":{},"tag":"td","children":["",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.LogVisualization"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["LogVisualization"],"type":"node"}],"type":"node"},""],"type":"node"},{"attributes":{},"tag":"td","children":["Logs visualization to a logging backend"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"tr","children":[{"attributes":{},"tag":"td","children":["",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.LogHistograms"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["LogHistograms"],"type":"node"}],"type":"node"},""],"type":"node"},{"attributes":{},"tag":"td","children":["Logs model weight histograms to a logging backend"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"p","children":["To construct a learner without default callbacks, pass ",{"attributes":{},"tag":"code","children":["usedefaultcallbacks=false"],"type":"node"}," when constructing it.",{"attributes":{},"tag":"br","children":[],"type":"node"},"For working with callbacks on an existing ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.Learner"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["Learner"],"type":"node"}],"type":"node"},", see:"],"type":"node"},{"attributes":{},"tag":"ul","children":[{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":[{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.setcallbacks!"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["setcallbacks!"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":[{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.addcallback!"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["addcallback!"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":[{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.getcallback"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["getcallback"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":[{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.replacecallback!"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["replacecallback!"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":[{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.removecallback!"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["removecallback!"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"p","children":["There are also some utilities for creating callbacks:"],"type":"node"},{"attributes":{},"tag":"ul","children":[{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":[{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.CustomCallback"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["CustomCallback"],"type":"node"}],"type":"node"}," to quickly hook a function into an event"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":[{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.throttle"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["throttle"],"type":"node"}],"type":"node"}," to run a callback only after every ",{"attributes":{},"tag":"code","children":["n"],"type":"node"}," events or every ",{"attributes":{},"tag":"code","children":["t"],"type":"node"}," seconds"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"h2","children":["Extension API"],"type":"node"},{"attributes":{},"tag":"p","children":["The following types and functions can be used to create custom callbacks. Read the ",{"attributes":{"href":"./custom.md","title":"","document_id":"FluxTraining@dev/doc/docs/callbacks/custom.md"},"tag":"reference","children":["custom callbacks guide"],"type":"node"}," for more context."],"type":"node"},{"attributes":{},"tag":"ul","children":[{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":[{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.Callback"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["Callback"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":[{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.stateaccess"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["stateaccess"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":[{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.runafter"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["runafter"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":[{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.resolveconflict"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["resolveconflict"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file +{"attributes":{"backlinks":[{"tag":"document","title":"Getting started","docid":"FluxTraining@dev/doc/docs/overview.md"},{"tag":"document","title":"Training loop","docid":"FluxTraining@dev/doc/docs/tutorials/training.md"},{"tag":"document","title":"Training an image classifier","docid":"FluxTraining@dev/doc/docs/tutorials/mnist.ipynb"},{"tag":"document","title":"News","docid":"FluxTraining@dev/doc/CHANGELOG.md"},{"tag":"document","title":"How to use callbacks","docid":"FluxTraining@dev/doc/docs/callbacks/usage.md"}],"path":"/home/runner/.julia/packages/FluxTraining/imTF4/docs/callbacks/reference.md","title":"Callback reference"},"tag":"document","children":[{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"h1","children":["Callback reference"],"type":"node"},{"attributes":{},"tag":"h2","children":["Included callbacks"],"type":"node"},{"attributes":{},"tag":"p","children":[{"attributes":{},"tag":"em","children":["FluxTraining.jl"],"type":"node"}," comes with many callbacks included. Some of them are added to ",{"attributes":{},"tag":"code","children":["Learner"],"type":"node"}," by default, here marked with a *."],"type":"node"},{"attributes":{"align":["left","left"]},"tag":"table","children":[{"attributes":{},"tag":"tr","children":[{"attributes":{},"tag":"th","children":["",{"attributes":{},"tag":"strong","children":["Callback"],"type":"node"},""],"type":"node"},{"attributes":{},"tag":"th","children":["",{"attributes":{},"tag":"strong","children":["Description"],"type":"node"},""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"tr","children":[{"attributes":{},"tag":"td","children":["",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.Metrics"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["Metrics"],"type":"node"}],"type":"node"},"*"],"type":"node"},{"attributes":{},"tag":"td","children":["Tracks loss and additional metrics on a per-step and per-epoch base"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"tr","children":[{"attributes":{},"tag":"td","children":["",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.Recorder"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["Recorder"],"type":"node"}],"type":"node"},"*"],"type":"node"},{"attributes":{},"tag":"td","children":["Records training stats like number of steps and epochs"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"tr","children":[{"attributes":{},"tag":"td","children":["",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.ProgressPrinter"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["ProgressPrinter"],"type":"node"}],"type":"node"},"*"],"type":"node"},{"attributes":{},"tag":"td","children":["Prints a progress bar for the current epoch during training"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"tr","children":[{"attributes":{},"tag":"td","children":["",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.MetricsPrinter"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["MetricsPrinter"],"type":"node"}],"type":"node"},"*"],"type":"node"},{"attributes":{},"tag":"td","children":["Prints out metrics after every epoch"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"tr","children":[{"attributes":{},"tag":"td","children":["",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.StopOnNaNLoss"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["StopOnNaNLoss"],"type":"node"}],"type":"node"},"*"],"type":"node"},{"attributes":{},"tag":"td","children":["Stops training early if a step loss is ",{"attributes":{},"tag":"code","children":["NaN"],"type":"node"},""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"tr","children":[{"attributes":{},"tag":"td","children":["",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.SanityCheck"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["SanityCheck"],"type":"node"}],"type":"node"},""],"type":"node"},{"attributes":{},"tag":"td","children":["Performs sanity checks on data, model and loss before training"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"tr","children":[{"attributes":{},"tag":"td","children":["",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.ToGPU"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["ToGPU"],"type":"node"}],"type":"node"},""],"type":"node"},{"attributes":{},"tag":"td","children":["Trains using a CUDA GPU if available"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"tr","children":[{"attributes":{},"tag":"td","children":["",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.Checkpointer"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["Checkpointer"],"type":"node"}],"type":"node"},""],"type":"node"},{"attributes":{},"tag":"td","children":["Saves the model after every epoch"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"tr","children":[{"attributes":{},"tag":"td","children":["",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.EarlyStopping"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["EarlyStopping"],"type":"node"}],"type":"node"},""],"type":"node"},{"attributes":{},"tag":"td","children":["Stops training early when a criterion is met"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"tr","children":[{"attributes":{},"tag":"td","children":["",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.Scheduler"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["Scheduler"],"type":"node"}],"type":"node"},""],"type":"node"},{"attributes":{},"tag":"td","children":["Schedules hyperparameters"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"tr","children":[{"attributes":{},"tag":"td","children":["",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.LogMetrics"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["LogMetrics"],"type":"node"}],"type":"node"},""],"type":"node"},{"attributes":{},"tag":"td","children":["Logs metrics to a logging backend"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"tr","children":[{"attributes":{},"tag":"td","children":["",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.LogHyperParams"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["LogHyperParams"],"type":"node"}],"type":"node"},""],"type":"node"},{"attributes":{},"tag":"td","children":["Logs hyperparameters to a logging backend"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"tr","children":[{"attributes":{},"tag":"td","children":["",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.LogVisualization"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["LogVisualization"],"type":"node"}],"type":"node"},""],"type":"node"},{"attributes":{},"tag":"td","children":["Logs visualization to a logging backend"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"tr","children":[{"attributes":{},"tag":"td","children":["",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.LogHistograms"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["LogHistograms"],"type":"node"}],"type":"node"},""],"type":"node"},{"attributes":{},"tag":"td","children":["Logs model weight histograms to a logging backend"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"p","children":["To construct a learner without default callbacks, pass ",{"attributes":{},"tag":"code","children":["usedefaultcallbacks=false"],"type":"node"}," when constructing it.",{"attributes":{},"tag":"br","children":[],"type":"node"},"For working with callbacks on an existing ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.Learner"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["Learner"],"type":"node"}],"type":"node"},", see:"],"type":"node"},{"attributes":{},"tag":"ul","children":[{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":[{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.setcallbacks!"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["setcallbacks!"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":[{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.addcallback!"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["addcallback!"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":[{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.getcallback"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["getcallback"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":[{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.replacecallback!"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["replacecallback!"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":[{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.removecallback!"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["removecallback!"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"p","children":["There are also some utilities for creating callbacks:"],"type":"node"},{"attributes":{},"tag":"ul","children":[{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":[{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.CustomCallback"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["CustomCallback"],"type":"node"}],"type":"node"}," to quickly hook a function into an event"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":[{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.throttle"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["throttle"],"type":"node"}],"type":"node"}," to run a callback only after every ",{"attributes":{},"tag":"code","children":["n"],"type":"node"}," events or every ",{"attributes":{},"tag":"code","children":["t"],"type":"node"}," seconds"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"h2","children":["Extension API"],"type":"node"},{"attributes":{},"tag":"p","children":["The following types and functions can be used to create custom callbacks. Read the ",{"attributes":{"href":"./custom.md","title":"","document_id":"FluxTraining@dev/doc/docs/callbacks/custom.md"},"tag":"reference","children":["custom callbacks guide"],"type":"node"}," for more context."],"type":"node"},{"attributes":{},"tag":"ul","children":[{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":[{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.Callback"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["Callback"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":[{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.stateaccess"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["stateaccess"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":[{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.runafter"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["runafter"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":[{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.resolveconflict"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["resolveconflict"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file diff --git a/data/FluxTraining@dev/doc/docs/callbacks/tipstricks.md.json b/data/FluxTraining@dev/doc/docs/callbacks/tipstricks.md.json index 5ebb48ad1..b6ca8e81a 100644 --- a/data/FluxTraining@dev/doc/docs/callbacks/tipstricks.md.json +++ b/data/FluxTraining@dev/doc/docs/callbacks/tipstricks.md.json @@ -1 +1 @@ -{"attributes":{"backlinks":[],"path":"/home/runner/.julia/packages/FluxTraining/xCOPx/docs/callbacks/tipstricks.md","title":"Tips & tricks"},"tag":"document","children":[{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"codecell","children":[{"attributes":{"cell":"main","lang":"julia","style":"display:none"},"tag":"codeinput","children":[{"attributes":{"result":"false","output":"false","cell":"main","lang":"julia","style":"display:none"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["FluxTraining"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["FluxTraining"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events"},"tag":"reference","children":["Events"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["FluxTraining"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases"},"tag":"reference","children":["Phases"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"h1","children":["Tips & tricks"],"type":"node"},{"attributes":{},"tag":"h2","children":["Listing event handlers for a callback"],"type":"node"},{"attributes":{},"tag":"p","children":["Use ",{"attributes":{},"tag":"code","children":["Base.methods"],"type":"node"}," to check what events a callback handles:"],"type":"node"},{"attributes":{},"tag":"codecell","children":[{"attributes":{"cell":"main","lang":"julia"},"tag":"codeinput","children":[{"attributes":{"cell":"main","lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["methods"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["FluxTraining"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.on"},"tag":"reference","children":["on"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Any"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Any"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Recorder"},"tag":"reference","children":["Recorder"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Any"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"coderesult","children":[{"mimes":{"text/html":"# 4 methods for generic function on:"},"type":"leaf"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"h2","children":["Visualize the callback dependency graph"],"type":"node"},{"attributes":{},"tag":"p","children":["You can use ",{"attributes":{"href":"https://juliagraphs.github.io/GraphPlot.jl/","title":""},"tag":"a","children":[{"attributes":{},"tag":"em","children":["GraphPlot.jl"],"type":"node"}],"type":"node"}," to visualize the dependencies between callbacks:"],"type":"node"},{"attributes":{},"tag":"codecell","children":[{"attributes":{"cell":"main","lang":"julia","style":"display:none"},"tag":"codeinput","children":[{"attributes":{"result":"false","output":"false","cell":"main","lang":"julia","style":"display:none"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"toplevel","children":[{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Learner"},"tag":"reference","children":["Learner"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["nothing"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["nothing"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Comment","children":["# dummy arguments"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"vect","children":[{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ToGPU"},"tag":"reference","children":["ToGPU"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":";","children":[";"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"codecell","children":[{"attributes":{"cell":"main","lang":"julia"},"tag":"codeinput","children":[{"attributes":{"cell":"main","lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["GraphPlot"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["gplot"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["graph"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["nodelabel"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbs"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["layout"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["stressmajorize_layout"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"coderesult","children":[{"mimes":{"text/html":"\n\n\n \n \n \n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n\n \n \n ToDevice(Flux.gpu, Flux.gpu)\n \n \n \n \n ProgressPrinter()\n \n \n \n \n MetricsPrinter()\n \n \n \n \n StopOnNaNLoss()\n \n \n \n \n Recorder()\n \n \n \n \n Metrics(Loss())\n \n \n\n\n\n"},"type":"leaf"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"p","children":[{"attributes":{},"tag":"em","children":["(the target of an arrow depends on the origin)"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"p","children":["As an example for a detected dependency, we can see that ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.MetricsPrinter"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["MetricsPrinter"],"type":"node"}],"type":"node"}," runs after ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.Metrics"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["Metrics"],"type":"node"}],"type":"node"},". ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.MetricsPrinter"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["MetricsPrinter"],"type":"node"}],"type":"node"}," prints the values of all metrics, so [",{"attributes":{},"tag":"code","children":["Metrics"],"type":"node"},"] needs to run first."],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file +{"attributes":{"backlinks":[],"path":"/home/runner/.julia/packages/FluxTraining/imTF4/docs/callbacks/tipstricks.md","title":"Tips & tricks"},"tag":"document","children":[{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"codecell","children":[{"attributes":{"cell":"main","lang":"julia","style":"display:none"},"tag":"codeinput","children":[{"attributes":{"result":"false","output":"false","cell":"main","lang":"julia","style":"display:none"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["FluxTraining"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["FluxTraining"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events"},"tag":"reference","children":["Events"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["FluxTraining"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases"},"tag":"reference","children":["Phases"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"h1","children":["Tips & tricks"],"type":"node"},{"attributes":{},"tag":"h2","children":["Listing event handlers for a callback"],"type":"node"},{"attributes":{},"tag":"p","children":["Use ",{"attributes":{},"tag":"code","children":["Base.methods"],"type":"node"}," to check what events a callback handles:"],"type":"node"},{"attributes":{},"tag":"codecell","children":[{"attributes":{"cell":"main","lang":"julia"},"tag":"codeinput","children":[{"attributes":{"cell":"main","lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["methods"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["FluxTraining"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.on"},"tag":"reference","children":["on"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Any"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Any"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Recorder"},"tag":"reference","children":["Recorder"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Any"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"coderesult","children":[{"mimes":{"text/html":"# 4 methods for generic function on:"},"type":"leaf"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"h2","children":["Visualize the callback dependency graph"],"type":"node"},{"attributes":{},"tag":"p","children":["You can use ",{"attributes":{"href":"https://juliagraphs.github.io/GraphPlot.jl/","title":""},"tag":"a","children":[{"attributes":{},"tag":"em","children":["GraphPlot.jl"],"type":"node"}],"type":"node"}," to visualize the dependencies between callbacks:"],"type":"node"},{"attributes":{},"tag":"codecell","children":[{"attributes":{"cell":"main","lang":"julia","style":"display:none"},"tag":"codeinput","children":[{"attributes":{"result":"false","output":"false","cell":"main","lang":"julia","style":"display:none"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"toplevel","children":[{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Learner"},"tag":"reference","children":["Learner"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["nothing"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["nothing"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Comment","children":["# dummy arguments"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"vect","children":[{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ToGPU"},"tag":"reference","children":["ToGPU"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":";","children":[";"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"codecell","children":[{"attributes":{"cell":"main","lang":"julia"},"tag":"codeinput","children":[{"attributes":{"cell":"main","lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["GraphPlot"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["gplot"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["graph"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["nodelabel"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbs"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["layout"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["stressmajorize_layout"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"coderesult","children":[{"mimes":{"text/html":"\n\n\n \n \n \n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n\n \n \n ToDevice(Flux.gpu, Flux.gpu)\n \n \n \n \n ProgressPrinter()\n \n \n \n \n MetricsPrinter()\n \n \n \n \n StopOnNaNLoss()\n \n \n \n \n Recorder()\n \n \n \n \n Metrics(Loss())\n \n \n\n\n\n"},"type":"leaf"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"p","children":[{"attributes":{},"tag":"em","children":["(the target of an arrow depends on the origin)"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"p","children":["As an example for a detected dependency, we can see that ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.MetricsPrinter"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["MetricsPrinter"],"type":"node"}],"type":"node"}," runs after ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.Metrics"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["Metrics"],"type":"node"}],"type":"node"},". ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.MetricsPrinter"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["MetricsPrinter"],"type":"node"}],"type":"node"}," prints the values of all metrics, so [",{"attributes":{},"tag":"code","children":["Metrics"],"type":"node"},"] needs to run first."],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file diff --git a/data/FluxTraining@dev/doc/docs/callbacks/usage.md.json b/data/FluxTraining@dev/doc/docs/callbacks/usage.md.json index 49e3c82f1..054885d75 100644 --- a/data/FluxTraining@dev/doc/docs/callbacks/usage.md.json +++ b/data/FluxTraining@dev/doc/docs/callbacks/usage.md.json @@ -1 +1 @@ -{"attributes":{"backlinks":[{"tag":"document","title":"Getting started","docid":"FluxTraining@dev/doc/docs/overview.md"}],"path":"/home/runner/.julia/packages/FluxTraining/xCOPx/docs/callbacks/usage.md","title":"How to use callbacks"},"tag":"document","children":[{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"codecell","children":[{"attributes":{"cell":"main","lang":"julia","style":"display:none"},"tag":"codeinput","children":[{"attributes":{"result":"false","output":"false","cell":"main","lang":"julia","style":"display:none"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["FluxTraining"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":":","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["FluxTraining"],"type":"node"}],"type":"node"},{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Callback"},"tag":"reference","children":["Callback"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Read"},"tag":"reference","children":["Read"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Write"},"tag":"reference","children":["Write"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.stateaccess"},"tag":"reference","children":["stateaccess"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["lossfn"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["nothing"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["nothing"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["nothing"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"h1","children":["How to use callbacks"],"type":"node"},{"attributes":{},"tag":"p","children":["Callbacks allow injecting functionality at many points during the training loop."],"type":"node"},{"attributes":{},"tag":"p","children":["To use them, simply pass each callback to ",{"attributes":{},"tag":"code","children":["Learner"],"type":"node"},":"],"type":"node"},{"attributes":{},"tag":"codecell","children":[{"attributes":{"cell":"main","lang":"julia"},"tag":"codeinput","children":[{"attributes":{"output":"false","cell":"main","lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Learner"},"tag":"reference","children":["Learner"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["lossfn"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Comment","children":["# required arguments"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"vect","children":[{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ToGPU"},"tag":"reference","children":["ToGPU"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Metrics"},"tag":"reference","children":["Metrics"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.accuracy"},"tag":"reference","children":["accuracy"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Comment","children":["# pass any number of callbacks as additional arguments"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"coderesult","children":[{"attributes":{},"tag":"codeblock","children":[{"mimes":{"text/html":"Learner()"},"type":"leaf"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"p","children":["Some useful callbacks are added by default. Below, the callbacks of ",{"attributes":{},"tag":"code","children":["learner"],"type":"node"}," are shown. Both the explicitly passed callbacks and the default ones are included:"],"type":"node"},{"attributes":{},"tag":"codecell","children":[{"attributes":{"cell":"main","lang":"julia"},"tag":"codeinput","children":[{"attributes":{"output":"false","cell":"main","lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbs"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"coderesult","children":[{"attributes":{},"tag":"codeblock","children":[{"mimes":{"text/html":"FluxTraining.SafeCallback[ToDevice(Flux.gpu, Flux.gpu), Metrics(Loss(), Metric(Accuracy)), ProgressPrinter(), MetricsPrinter(), StopOnNaNLoss(), Recorder()]"},"type":"leaf"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"p","children":["See ",{"attributes":{"href":"./reference.md","title":"","document_id":"FluxTraining@dev/doc/docs/callbacks/reference.md"},"tag":"reference","children":["callback reference"],"type":"node"}," for a list of all callbacks included in ",{"attributes":{},"tag":"em","children":["FluxTraining.jl"],"type":"node"}," and their documentation."],"type":"node"},{"attributes":{"class":"info"},"tag":"admonition","children":[{"attributes":{},"tag":"admonitiontitle","children":["Ordering"],"type":"node"},{"attributes":{},"tag":"admonitionbody","children":[{"attributes":{},"tag":"p","children":["The order the callbacks are passed in doesn't matter. ",{"attributes":{},"tag":"em","children":["FluxTraining.jl"],"type":"node"}," creates a dependency graph that makes sure the callbacks are run in the correct order. Read ",{"attributes":{"href":"./custom.md","title":"","document_id":"FluxTraining@dev/doc/docs/callbacks/custom.md"},"tag":"reference","children":["custom callbacks"],"type":"node"}," to find out how to create callbacks yourself."],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file +{"attributes":{"backlinks":[{"tag":"document","title":"Getting started","docid":"FluxTraining@dev/doc/docs/overview.md"}],"path":"/home/runner/.julia/packages/FluxTraining/imTF4/docs/callbacks/usage.md","title":"How to use callbacks"},"tag":"document","children":[{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"codecell","children":[{"attributes":{"cell":"main","lang":"julia","style":"display:none"},"tag":"codeinput","children":[{"attributes":{"result":"false","output":"false","cell":"main","lang":"julia","style":"display:none"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["FluxTraining"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":":","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["FluxTraining"],"type":"node"}],"type":"node"},{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Callback"},"tag":"reference","children":["Callback"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Read"},"tag":"reference","children":["Read"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Write"},"tag":"reference","children":["Write"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.stateaccess"},"tag":"reference","children":["stateaccess"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["lossfn"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["nothing"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["nothing"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["nothing"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"h1","children":["How to use callbacks"],"type":"node"},{"attributes":{},"tag":"p","children":["Callbacks allow injecting functionality at many points during the training loop."],"type":"node"},{"attributes":{},"tag":"p","children":["To use them, simply pass each callback to ",{"attributes":{},"tag":"code","children":["Learner"],"type":"node"},":"],"type":"node"},{"attributes":{},"tag":"codecell","children":[{"attributes":{"cell":"main","lang":"julia"},"tag":"codeinput","children":[{"attributes":{"output":"false","cell":"main","lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Learner"},"tag":"reference","children":["Learner"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["lossfn"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Comment","children":["# required arguments"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"vect","children":[{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ToGPU"},"tag":"reference","children":["ToGPU"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Metrics"},"tag":"reference","children":["Metrics"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.accuracy"},"tag":"reference","children":["accuracy"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Comment","children":["# pass any number of callbacks as additional arguments"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"coderesult","children":[{"attributes":{},"tag":"codeblock","children":[{"mimes":{"text/html":"Learner()"},"type":"leaf"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"p","children":["Some useful callbacks are added by default. Below, the callbacks of ",{"attributes":{},"tag":"code","children":["learner"],"type":"node"}," are shown. Both the explicitly passed callbacks and the default ones are included:"],"type":"node"},{"attributes":{},"tag":"codecell","children":[{"attributes":{"cell":"main","lang":"julia"},"tag":"codeinput","children":[{"attributes":{"output":"false","cell":"main","lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbs"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"coderesult","children":[{"attributes":{},"tag":"codeblock","children":[{"mimes":{"text/html":"FluxTraining.SafeCallback[ToDevice(Flux.gpu, Flux.gpu), Metrics(Loss(), Metric(Accuracy)), ProgressPrinter(), MetricsPrinter(), StopOnNaNLoss(), Recorder()]"},"type":"leaf"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"p","children":["See ",{"attributes":{"href":"./reference.md","title":"","document_id":"FluxTraining@dev/doc/docs/callbacks/reference.md"},"tag":"reference","children":["callback reference"],"type":"node"}," for a list of all callbacks included in ",{"attributes":{},"tag":"em","children":["FluxTraining.jl"],"type":"node"}," and their documentation."],"type":"node"},{"attributes":{"class":"info"},"tag":"admonition","children":[{"attributes":{},"tag":"admonitiontitle","children":["Ordering"],"type":"node"},{"attributes":{},"tag":"admonitionbody","children":[{"attributes":{},"tag":"p","children":["The order the callbacks are passed in doesn't matter. ",{"attributes":{},"tag":"em","children":["FluxTraining.jl"],"type":"node"}," creates a dependency graph that makes sure the callbacks are run in the correct order. Read ",{"attributes":{"href":"./custom.md","title":"","document_id":"FluxTraining@dev/doc/docs/callbacks/custom.md"},"tag":"reference","children":["custom callbacks"],"type":"node"}," to find out how to create callbacks yourself."],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file diff --git a/data/FluxTraining@dev/doc/docs/custom_training.ipynb.json b/data/FluxTraining@dev/doc/docs/custom_training.ipynb.json index 475470675..f3c4fa015 100644 --- a/data/FluxTraining@dev/doc/docs/custom_training.ipynb.json +++ b/data/FluxTraining@dev/doc/docs/custom_training.ipynb.json @@ -1 +1 @@ -{"attributes":{"backlinks":[],"path":"/home/runner/.julia/packages/FluxTraining/xCOPx/docs/custom_training.ipynb","title":"Custom training loops"},"tag":"document","children":[{"attributes":{"nbformat":[4,4],"kernelspec":{"display_name":"Julia (12 threads) 1.5.0","language":"julia","name":"julia-(12-threads)-1.5"},"language_info":{"file_extension":".jl","mimetype":"application/julia","name":"julia","version":"1.5.0"}},"tag":"jupyter","children":[{"attributes":{"id":null},"tag":"md","children":[{"attributes":{},"tag":"h1","children":["Custom training loops"],"type":"node"}],"type":"node"},{"attributes":{"id":null},"tag":"md","children":[{"attributes":{},"tag":"p","children":["How can we compose changes to the training loop together?"],"type":"node"},{"attributes":{},"tag":"p","children":["As an example, we want to be able to do data-parallel training or GAN training, but also data-parallel GAN training."],"type":"node"},{"attributes":{},"tag":"p","children":["I want to give some thoughts on this and propose possible solutions to make this possible in ",{"attributes":{},"tag":"em","children":["FastAI.jl"],"type":"node"},"."],"type":"node"},{"attributes":{},"tag":"p","children":["Currently, implementing custom training behavior is possible by subtyping ",{"attributes":{},"tag":"code","children":["FitPhase"],"type":"node"}," and implementing ",{"attributes":{},"tag":"code","children":["fitbatchphase!(learner, phase::MyPhase)"],"type":"node"},". However, this is not composable, i.e. it doesn't allow you to combine a ",{"attributes":{},"tag":"code","children":["DataParallelTrainingPhase"],"type":"node"}," and ",{"attributes":{},"tag":"code","children":["GANTrainingPhase"],"type":"node"},"."],"type":"node"},{"attributes":{},"tag":"p","children":["Below are some examples that show how the contents of ",{"attributes":{},"tag":"code","children":["fitbatchphase!"],"type":"node"}," can be changed to illustrate this. For simplicity, they don't include callbacks and state handling."],"type":"node"}],"type":"node"},{"attributes":{"id":null},"tag":"md","children":[{"attributes":{},"tag":"h4","children":["Regular training (1)"],"type":"node"}],"type":"node"},{"attributes":{"id":null,"execution_count":8},"tag":"codecell","children":[{"attributes":{},"tag":"codeinput","children":[{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"Comment","children":["# inputs: model, xs, ys, lossfn, optim, params"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["grads"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"do","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["gradient"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["params"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"do","children":["do"],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["lossfn"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["xs"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ys"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["update!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["optim"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["params"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["sum"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["grads"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{"id":null},"tag":"md","children":[{"attributes":{},"tag":"h4","children":["Data-parallel training on CPU (2)"],"type":"node"}],"type":"node"},{"attributes":{"id":null,"execution_count":null},"tag":"codecell","children":[{"attributes":{},"tag":"codeinput","children":[{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"Comment","children":["# inputs: model, xs, ys, lossfn, optim, params"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["grads"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"curly","children":[{"attributes":{},"tag":"Identifier","children":["Array"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Grads"],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["undef"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Threads"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["nthreads"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"Comment","children":["# run equally-sized slices of the batch in parallel (naive pseudocode)"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Threads"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["threads"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"for","children":[{"attributes":{},"tag":"for","children":["for"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["i"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["xs_"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ys_"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"in","children":["in"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["enumerate"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["scatter"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["xs"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ys"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Threads"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["nthreads"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":"Identifier","children":["grads"],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["i"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"do","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["gradient"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["params"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"do","children":["do"],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["lossfn"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["xs_"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ys_"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["gs"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["sum"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["grads"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"Comment","children":["# do parameter update with summed gradients"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["update!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["optim"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["params"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["gs"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{"id":null},"tag":"md","children":[{"attributes":{},"tag":"h4","children":["GAN training (3)"],"type":"node"}],"type":"node"},{"attributes":{"id":null,"execution_count":null},"tag":"codecell","children":[{"attributes":{},"tag":"codeinput","children":[{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"Comment","children":["# inputs: mgen, mcrit, paramsgen, paramscrit, xs_true, lossfngen, lossfncrit, optim, batchsize"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"Comment","children":["# critic step"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["xs_fake"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["mgen"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["batchsize"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["xs"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["cat"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["xs_true"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["xs_fake"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["ys"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["onehot"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["vcat"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["trues"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["batchsize"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["falses"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["batchsize"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["grads"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"do","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["gradient"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["paramscrit"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"do","children":["do"],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["lossfncrit"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["mcrit"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["xs"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ys"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["update!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["optim"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["paramscrit"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["grads"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"Comment","children":["# generator step"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["grads"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"do","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["gradient"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["paramsgen"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"do","children":["do"],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["xs_fake"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["mgen"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["batchsize"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["ys_fake"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["onehot"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["falses"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["batchsize"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"-","children":["-"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["lossfncrit"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["crit"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["xs_fake"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ys_fake"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{"id":null},"tag":"md","children":[{"attributes":{},"tag":"h3","children":["Solutions"],"type":"node"},{"attributes":{},"tag":"p","children":["I have found two approaches to deal with this. ",{"attributes":{},"tag":"strong","children":["Both focus on removing execution logic from ",{"attributes":{},"tag":"code","children":["fitbatchphase!"],"type":"node"},", making them composable with custom ",{"attributes":{},"tag":"code","children":["Phase"],"type":"node"},"s"],"type":"node"}," like ",{"attributes":{},"tag":"code","children":["GANTrainingPhase"],"type":"node"}," that change"],"type":"node"},{"attributes":{},"tag":"p","children":["the ",{"attributes":{},"tag":"em","children":["semantics"],"type":"node"}," of the training loop."],"type":"node"},{"attributes":{},"tag":"p","children":["On one hand, there are extensions to the training loop that change the ",{"attributes":{},"tag":"em","children":["execution"],"type":"node"}," (e.g. parallel and distributed CPU and GPU training), on the other hand you have those that change the ",{"attributes":{},"tag":"em","children":["semantics"],"type":"node"}," (e.g. GAN training)."],"type":"node"},{"attributes":{},"tag":"p","children":["The proposed solutions make the assumption that different ",{"attributes":{},"tag":"em","children":["semantics"],"type":"node"}," don't need to be composed, but should be composable with different execution contexts."],"type":"node"}],"type":"node"},{"attributes":{"id":null},"tag":"md","children":[{"attributes":{},"tag":"h4","children":["(S1) Abstract gradient step (and possibly others) out"],"type":"node"}],"type":"node"},{"attributes":{"id":null},"tag":"md","children":[{"attributes":{},"tag":"p","children":["Modifications to the execution of the training loop could be implemented by wrapping in an execution context."],"type":"node"},{"attributes":{},"tag":"p","children":["In the below example ",{"attributes":{},"tag":"code","children":["gradientphase"],"type":"node"}," could dispatch to the regular gradient calculation in (1) or the data-parallel approach (2) depending on ",{"attributes":{},"tag":"code","children":["executionctx"],"type":"node"},"."],"type":"node"},{"attributes":{},"tag":"p","children":["This would mean that only ",{"attributes":{},"tag":"em","children":["semantic"],"type":"node"}," changes to the training loop would use overloading of ",{"attributes":{},"tag":"code","children":["fitbatchphase!"],"type":"node"}," with a custom ",{"attributes":{},"tag":"code","children":["FitPhase"],"type":"node"},". Changes to the ",{"attributes":{},"tag":"em","children":["execution"],"type":"node"}," work by dispatching on execution contexts, e.g. ",{"attributes":{},"tag":"code","children":["gradientphase(::Linear, ...)"],"type":"node"}," or ",{"attributes":{},"tag":"code","children":["gradientphase(::DataParallel, ...)"],"type":"node"},"."],"type":"node"}],"type":"node"},{"attributes":{"id":null,"execution_count":null},"tag":"codecell","children":[{"attributes":{},"tag":"codeinput","children":[{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"Comment","children":["# gradientphase passes (possibly modified) state to a closure"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"Comment","children":["# in the case executionctx::DataParallel, xs_, ys_ will be slices"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"Comment","children":["# of the batch."],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["grads"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"do","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["gradient"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["executionctx"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["params"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"do","children":["do"],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["model_"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["params_"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["xs_"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ys_"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":[" \n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["lossfn"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["xs_"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ys_"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["update!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["optim"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["params"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["grads"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{"id":null},"tag":"md","children":[{"attributes":{},"tag":"p","children":[{"attributes":{},"tag":"strong","children":["Advantages"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"ul","children":[{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["implementation definitely doable"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"p","children":[{"attributes":{},"tag":"strong","children":["Disadvantages"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"ul","children":[{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["implementation dependent on requirements, i.e. unsure which pieces of the training step need to be overloadable and which state needs to be passed to closures."],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{"id":null},"tag":"md","children":[{"attributes":{},"tag":"h4","children":["(S2) Wrapper for ",{"attributes":{},"tag":"code","children":["model"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{"id":null},"tag":"md","children":[{"attributes":{},"tag":"p","children":["The idea is to wrap the ",{"attributes":{},"tag":"code","children":["model"],"type":"node"}," in an execution context, e.g. ",{"attributes":{},"tag":"code","children":["DataParallel(model)"],"type":"node"},". The wrapper is then responsible for exhibiting the correct behavior on the forward and backward pass. This is ",{"attributes":{"href":"https://pytorch.org/docs/stable/generated/torch.nn.DataParallel.html?highlight=parallel#torch.nn.DataParallel","title":""},"tag":"a","children":["what PyTorch does"],"type":"node"},"."],"type":"node"},{"attributes":{},"tag":"p","children":["No changes to the training loop would need to be made. The implementation for the forward pass should be straightforward and similar to the above sketch (2), however I'm not sure how to make sure that the backward pass is also computed in parallel (can custom gradient definitions include multi-threading code?, what about the loss function that is not wrapped?)."],"type":"node"}],"type":"node"},{"attributes":{"id":null,"execution_count":null},"tag":"codecell","children":[{"attributes":{},"tag":"codeinput","children":[{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"Comment","children":["# before training"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["DataParallel"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"Comment","children":["# training step doesn't change at all"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["grads"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"do","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["gradient"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["params"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"do","children":["do"],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["lossfn"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["xs"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ys"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["update!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["optim"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["params"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["sum"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["grads"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{"id":null},"tag":"md","children":[{"attributes":{},"tag":"p","children":[{"attributes":{},"tag":"strong","children":["Advantages"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"ul","children":[{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["no changes needed to state and event handling"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"p","children":[{"attributes":{},"tag":"strong","children":["Disadvantages"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"ul","children":[{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["not sure if such a simple API is possible to implement for all scenarios"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["bit unelegant; model is not a pure function anymore"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file +{"attributes":{"backlinks":[],"path":"/home/runner/.julia/packages/FluxTraining/imTF4/docs/custom_training.ipynb","title":"Custom training loops"},"tag":"document","children":[{"attributes":{"nbformat":[4,4],"kernelspec":{"display_name":"Julia (12 threads) 1.5.0","language":"julia","name":"julia-(12-threads)-1.5"},"language_info":{"file_extension":".jl","mimetype":"application/julia","name":"julia","version":"1.5.0"}},"tag":"jupyter","children":[{"attributes":{"id":null},"tag":"md","children":[{"attributes":{},"tag":"h1","children":["Custom training loops"],"type":"node"}],"type":"node"},{"attributes":{"id":null},"tag":"md","children":[{"attributes":{},"tag":"p","children":["How can we compose changes to the training loop together?"],"type":"node"},{"attributes":{},"tag":"p","children":["As an example, we want to be able to do data-parallel training or GAN training, but also data-parallel GAN training."],"type":"node"},{"attributes":{},"tag":"p","children":["I want to give some thoughts on this and propose possible solutions to make this possible in ",{"attributes":{},"tag":"em","children":["FastAI.jl"],"type":"node"},"."],"type":"node"},{"attributes":{},"tag":"p","children":["Currently, implementing custom training behavior is possible by subtyping ",{"attributes":{},"tag":"code","children":["FitPhase"],"type":"node"}," and implementing ",{"attributes":{},"tag":"code","children":["fitbatchphase!(learner, phase::MyPhase)"],"type":"node"},". However, this is not composable, i.e. it doesn't allow you to combine a ",{"attributes":{},"tag":"code","children":["DataParallelTrainingPhase"],"type":"node"}," and ",{"attributes":{},"tag":"code","children":["GANTrainingPhase"],"type":"node"},"."],"type":"node"},{"attributes":{},"tag":"p","children":["Below are some examples that show how the contents of ",{"attributes":{},"tag":"code","children":["fitbatchphase!"],"type":"node"}," can be changed to illustrate this. For simplicity, they don't include callbacks and state handling."],"type":"node"}],"type":"node"},{"attributes":{"id":null},"tag":"md","children":[{"attributes":{},"tag":"h4","children":["Regular training (1)"],"type":"node"}],"type":"node"},{"attributes":{"id":null,"execution_count":8},"tag":"codecell","children":[{"attributes":{},"tag":"codeinput","children":[{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"Comment","children":["# inputs: model, xs, ys, lossfn, optim, params"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["grads"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"do","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["gradient"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["params"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"do","children":["do"],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["lossfn"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["xs"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ys"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["update!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["optim"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["params"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["sum"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["grads"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{"id":null},"tag":"md","children":[{"attributes":{},"tag":"h4","children":["Data-parallel training on CPU (2)"],"type":"node"}],"type":"node"},{"attributes":{"id":null,"execution_count":null},"tag":"codecell","children":[{"attributes":{},"tag":"codeinput","children":[{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"Comment","children":["# inputs: model, xs, ys, lossfn, optim, params"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["grads"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"curly","children":[{"attributes":{},"tag":"Identifier","children":["Array"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Grads"],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["undef"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Threads"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["nthreads"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"Comment","children":["# run equally-sized slices of the batch in parallel (naive pseudocode)"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Threads"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["threads"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"for","children":[{"attributes":{},"tag":"for","children":["for"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["i"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["xs_"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ys_"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"in","children":["in"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["enumerate"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["scatter"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["xs"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ys"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Threads"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["nthreads"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":"Identifier","children":["grads"],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["i"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"do","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["gradient"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["params"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"do","children":["do"],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["lossfn"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["xs_"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ys_"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["gs"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["sum"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["grads"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"Comment","children":["# do parameter update with summed gradients"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["update!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["optim"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["params"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["gs"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{"id":null},"tag":"md","children":[{"attributes":{},"tag":"h4","children":["GAN training (3)"],"type":"node"}],"type":"node"},{"attributes":{"id":null,"execution_count":null},"tag":"codecell","children":[{"attributes":{},"tag":"codeinput","children":[{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"Comment","children":["# inputs: mgen, mcrit, paramsgen, paramscrit, xs_true, lossfngen, lossfncrit, optim, batchsize"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"Comment","children":["# critic step"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["xs_fake"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["mgen"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["batchsize"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["xs"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["cat"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["xs_true"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["xs_fake"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["ys"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["onehot"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["vcat"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["trues"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["batchsize"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["falses"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["batchsize"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["grads"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"do","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["gradient"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["paramscrit"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"do","children":["do"],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["lossfncrit"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["mcrit"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["xs"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ys"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["update!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["optim"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["paramscrit"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["grads"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"Comment","children":["# generator step"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["grads"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"do","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["gradient"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["paramsgen"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"do","children":["do"],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["xs_fake"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["mgen"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["batchsize"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["ys_fake"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["onehot"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["falses"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["batchsize"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"-","children":["-"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["lossfncrit"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["crit"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["xs_fake"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ys_fake"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{"id":null},"tag":"md","children":[{"attributes":{},"tag":"h3","children":["Solutions"],"type":"node"},{"attributes":{},"tag":"p","children":["I have found two approaches to deal with this. ",{"attributes":{},"tag":"strong","children":["Both focus on removing execution logic from ",{"attributes":{},"tag":"code","children":["fitbatchphase!"],"type":"node"},", making them composable with custom ",{"attributes":{},"tag":"code","children":["Phase"],"type":"node"},"s"],"type":"node"}," like ",{"attributes":{},"tag":"code","children":["GANTrainingPhase"],"type":"node"}," that change"],"type":"node"},{"attributes":{},"tag":"p","children":["the ",{"attributes":{},"tag":"em","children":["semantics"],"type":"node"}," of the training loop."],"type":"node"},{"attributes":{},"tag":"p","children":["On one hand, there are extensions to the training loop that change the ",{"attributes":{},"tag":"em","children":["execution"],"type":"node"}," (e.g. parallel and distributed CPU and GPU training), on the other hand you have those that change the ",{"attributes":{},"tag":"em","children":["semantics"],"type":"node"}," (e.g. GAN training)."],"type":"node"},{"attributes":{},"tag":"p","children":["The proposed solutions make the assumption that different ",{"attributes":{},"tag":"em","children":["semantics"],"type":"node"}," don't need to be composed, but should be composable with different execution contexts."],"type":"node"}],"type":"node"},{"attributes":{"id":null},"tag":"md","children":[{"attributes":{},"tag":"h4","children":["(S1) Abstract gradient step (and possibly others) out"],"type":"node"}],"type":"node"},{"attributes":{"id":null},"tag":"md","children":[{"attributes":{},"tag":"p","children":["Modifications to the execution of the training loop could be implemented by wrapping in an execution context."],"type":"node"},{"attributes":{},"tag":"p","children":["In the below example ",{"attributes":{},"tag":"code","children":["gradientphase"],"type":"node"}," could dispatch to the regular gradient calculation in (1) or the data-parallel approach (2) depending on ",{"attributes":{},"tag":"code","children":["executionctx"],"type":"node"},"."],"type":"node"},{"attributes":{},"tag":"p","children":["This would mean that only ",{"attributes":{},"tag":"em","children":["semantic"],"type":"node"}," changes to the training loop would use overloading of ",{"attributes":{},"tag":"code","children":["fitbatchphase!"],"type":"node"}," with a custom ",{"attributes":{},"tag":"code","children":["FitPhase"],"type":"node"},". Changes to the ",{"attributes":{},"tag":"em","children":["execution"],"type":"node"}," work by dispatching on execution contexts, e.g. ",{"attributes":{},"tag":"code","children":["gradientphase(::Linear, ...)"],"type":"node"}," or ",{"attributes":{},"tag":"code","children":["gradientphase(::DataParallel, ...)"],"type":"node"},"."],"type":"node"}],"type":"node"},{"attributes":{"id":null,"execution_count":null},"tag":"codecell","children":[{"attributes":{},"tag":"codeinput","children":[{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"Comment","children":["# gradientphase passes (possibly modified) state to a closure"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"Comment","children":["# in the case executionctx::DataParallel, xs_, ys_ will be slices"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"Comment","children":["# of the batch."],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["grads"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"do","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["gradient"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["executionctx"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["params"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"do","children":["do"],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["model_"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["params_"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["xs_"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ys_"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":[" \n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["lossfn"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["xs_"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ys_"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["update!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["optim"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["params"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["grads"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{"id":null},"tag":"md","children":[{"attributes":{},"tag":"p","children":[{"attributes":{},"tag":"strong","children":["Advantages"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"ul","children":[{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["implementation definitely doable"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"p","children":[{"attributes":{},"tag":"strong","children":["Disadvantages"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"ul","children":[{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["implementation dependent on requirements, i.e. unsure which pieces of the training step need to be overloadable and which state needs to be passed to closures."],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{"id":null},"tag":"md","children":[{"attributes":{},"tag":"h4","children":["(S2) Wrapper for ",{"attributes":{},"tag":"code","children":["model"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{"id":null},"tag":"md","children":[{"attributes":{},"tag":"p","children":["The idea is to wrap the ",{"attributes":{},"tag":"code","children":["model"],"type":"node"}," in an execution context, e.g. ",{"attributes":{},"tag":"code","children":["DataParallel(model)"],"type":"node"},". The wrapper is then responsible for exhibiting the correct behavior on the forward and backward pass. This is ",{"attributes":{"href":"https://pytorch.org/docs/stable/generated/torch.nn.DataParallel.html?highlight=parallel#torch.nn.DataParallel","title":""},"tag":"a","children":["what PyTorch does"],"type":"node"},"."],"type":"node"},{"attributes":{},"tag":"p","children":["No changes to the training loop would need to be made. The implementation for the forward pass should be straightforward and similar to the above sketch (2), however I'm not sure how to make sure that the backward pass is also computed in parallel (can custom gradient definitions include multi-threading code?, what about the loss function that is not wrapped?)."],"type":"node"}],"type":"node"},{"attributes":{"id":null,"execution_count":null},"tag":"codecell","children":[{"attributes":{},"tag":"codeinput","children":[{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"Comment","children":["# before training"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["DataParallel"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"Comment","children":["# training step doesn't change at all"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["grads"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"do","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["gradient"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["params"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"do","children":["do"],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["lossfn"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["xs"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ys"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["update!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["optim"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["params"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["sum"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["grads"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{"id":null},"tag":"md","children":[{"attributes":{},"tag":"p","children":[{"attributes":{},"tag":"strong","children":["Advantages"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"ul","children":[{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["no changes needed to state and event handling"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"p","children":[{"attributes":{},"tag":"strong","children":["Disadvantages"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"ul","children":[{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["not sure if such a simple API is possible to implement for all scenarios"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["bit unelegant; model is not a pure function anymore"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file diff --git a/data/FluxTraining@dev/doc/docs/features.md.json b/data/FluxTraining@dev/doc/docs/features.md.json index dbb4b757e..d71e956da 100644 --- a/data/FluxTraining@dev/doc/docs/features.md.json +++ b/data/FluxTraining@dev/doc/docs/features.md.json @@ -1 +1 @@ -{"attributes":{"backlinks":[],"path":"/home/runner/.julia/packages/FluxTraining/xCOPx/docs/features.md","title":"Features"},"tag":"document","children":[{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"h1","children":["Features"],"type":"node"},{"attributes":{},"tag":"p","children":["This page gives a run-down of many features ",{"attributes":{},"tag":"em","children":["FluxTraining.jl"],"type":"node"}," brings to the table. Most features are implemented as callbacks and using them is as simple as passing the callback when constructing a ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.Learner"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["Learner"],"type":"node"}],"type":"node"}," and training with ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.fit!"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["fit!"],"type":"node"}],"type":"node"},":"],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["CoolFeature🕶️Callback"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Learner"},"tag":"reference","children":["Learner"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["lossfn"],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"vect","children":[{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["trainiter"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["validiter"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.fit!"},"tag":"reference","children":["fit!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["nepochs"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"h2","children":["Metrics"],"type":"node"},{"attributes":{},"tag":"p","children":["By default, ",{"attributes":{},"tag":"code","children":["Learner"],"type":"node"}," will track only the loss function. You can track other metric with the ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.Metrics"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["Metrics"],"type":"node"}],"type":"node"}," callback. See also ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.Metric"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["Metric"],"type":"node"}],"type":"node"},", ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.AbstractMetric"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["AbstractMetric"],"type":"node"}],"type":"node"},"."],"type":"node"},{"attributes":{},"tag":"h2","children":["Hyperparameter scheduling"],"type":"node"},{"attributes":{},"tag":"p","children":["The ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.Scheduler"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["Scheduler"],"type":"node"}],"type":"node"}," callback takes care of hyperparameter scheduling. See the ",{"attributes":{"href":"tutorials/hyperparameters.md","title":"","document_id":"FluxTraining@dev/doc/docs/tutorials/hyperparameters.md"},"tag":"reference","children":["Hyperparameter scheduling tutorial"],"type":"node"}," and also ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.Scheduler"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["Scheduler"],"type":"node"}],"type":"node"},", ",{"attributes":{"href":"#","title":""},"tag":"a","children":[{"attributes":{},"tag":"code","children":["Schedule"],"type":"node"}],"type":"node"},", ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.HyperParameter"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["HyperParameter"],"type":"node"}],"type":"node"},"."],"type":"node"},{"attributes":{},"tag":"h2","children":["Logging"],"type":"node"},{"attributes":{},"tag":"p","children":["For logging, use the logging callbacks:"],"type":"node"},{"attributes":{},"tag":"ul","children":[{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":[{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.LogMetrics"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["LogMetrics"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":[{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.LogHyperParams"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["LogHyperParams"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":[{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.LogHistograms"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["LogHistograms"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"p","children":["They each can have multiple logging backends, but right now the only one implemented in ",{"attributes":{},"tag":"em","children":["FluxTraining.jl"],"type":"node"}," is ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.TensorBoardBackend"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["TensorBoardBackend"],"type":"node"}],"type":"node"},". See also ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.LoggerBackend"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["LoggerBackend"],"type":"node"}],"type":"node"},", ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.log_to"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["log_to"],"type":"node"}],"type":"node"},", and ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.Loggables.Loggable"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["Loggables.Loggable"],"type":"node"}],"type":"node"},"."],"type":"node"},{"attributes":{},"tag":"p","children":["There is also an external package ",{"attributes":{"href":"https://github.com/avik-pal/Wandb.jl","title":""},"tag":"a","children":["Wandb.jl"],"type":"node"}," that implements a logging backend for ",{"attributes":{"href":"https://wandb.ai","title":""},"tag":"a","children":["Weights&Biases"],"type":"node"},"."],"type":"node"},{"attributes":{},"tag":"h2","children":["Checkpointing"],"type":"node"},{"attributes":{},"tag":"p","children":["Use the ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.Checkpointer"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["Checkpointer"],"type":"node"}],"type":"node"}," callback to create model checkpoints after every epoch."],"type":"node"},{"attributes":{},"tag":"h2","children":["Early Stopping"],"type":"node"},{"attributes":{},"tag":"p","children":["Use ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.EarlyStopping"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["EarlyStopping"],"type":"node"}],"type":"node"}," to stop when a stopping criterion is met. Supports all criteria in ",{"attributes":{"href":"https://github.com/ablaom/EarlyStopping.jl","title":""},"tag":"a","children":["EarlyStopping.jl"],"type":"node"},"."],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file +{"attributes":{"backlinks":[],"path":"/home/runner/.julia/packages/FluxTraining/imTF4/docs/features.md","title":"Features"},"tag":"document","children":[{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"h1","children":["Features"],"type":"node"},{"attributes":{},"tag":"p","children":["This page gives a run-down of many features ",{"attributes":{},"tag":"em","children":["FluxTraining.jl"],"type":"node"}," brings to the table. Most features are implemented as callbacks and using them is as simple as passing the callback when constructing a ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.Learner"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["Learner"],"type":"node"}],"type":"node"}," and training with ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.fit!"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["fit!"],"type":"node"}],"type":"node"},":"],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["CoolFeature🕶️Callback"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Learner"},"tag":"reference","children":["Learner"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["lossfn"],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"vect","children":[{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["trainiter"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["validiter"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.fit!"},"tag":"reference","children":["fit!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["nepochs"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"h2","children":["Metrics"],"type":"node"},{"attributes":{},"tag":"p","children":["By default, ",{"attributes":{},"tag":"code","children":["Learner"],"type":"node"}," will track only the loss function. You can track other metric with the ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.Metrics"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["Metrics"],"type":"node"}],"type":"node"}," callback. See also ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.Metric"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["Metric"],"type":"node"}],"type":"node"},", ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.AbstractMetric"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["AbstractMetric"],"type":"node"}],"type":"node"},"."],"type":"node"},{"attributes":{},"tag":"h2","children":["Hyperparameter scheduling"],"type":"node"},{"attributes":{},"tag":"p","children":["The ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.Scheduler"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["Scheduler"],"type":"node"}],"type":"node"}," callback takes care of hyperparameter scheduling. See the ",{"attributes":{"href":"tutorials/hyperparameters.md","title":"","document_id":"FluxTraining@dev/doc/docs/tutorials/hyperparameters.md"},"tag":"reference","children":["Hyperparameter scheduling tutorial"],"type":"node"}," and also ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.Scheduler"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["Scheduler"],"type":"node"}],"type":"node"},", ",{"attributes":{"href":"#","title":""},"tag":"a","children":[{"attributes":{},"tag":"code","children":["Schedule"],"type":"node"}],"type":"node"},", ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.HyperParameter"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["HyperParameter"],"type":"node"}],"type":"node"},"."],"type":"node"},{"attributes":{},"tag":"h2","children":["Logging"],"type":"node"},{"attributes":{},"tag":"p","children":["For logging, use the logging callbacks:"],"type":"node"},{"attributes":{},"tag":"ul","children":[{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":[{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.LogMetrics"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["LogMetrics"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":[{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.LogHyperParams"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["LogHyperParams"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":[{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.LogHistograms"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["LogHistograms"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"p","children":["They each can have multiple logging backends, but right now the only one implemented in ",{"attributes":{},"tag":"em","children":["FluxTraining.jl"],"type":"node"}," is ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.TensorBoardBackend"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["TensorBoardBackend"],"type":"node"}],"type":"node"},". See also ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.LoggerBackend"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["LoggerBackend"],"type":"node"}],"type":"node"},", ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.log_to"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["log_to"],"type":"node"}],"type":"node"},", and ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.Loggables.Loggable"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["Loggables.Loggable"],"type":"node"}],"type":"node"},"."],"type":"node"},{"attributes":{},"tag":"p","children":["There is also an external package ",{"attributes":{"href":"https://github.com/avik-pal/Wandb.jl","title":""},"tag":"a","children":["Wandb.jl"],"type":"node"}," that implements a logging backend for ",{"attributes":{"href":"https://wandb.ai","title":""},"tag":"a","children":["Weights&Biases"],"type":"node"},"."],"type":"node"},{"attributes":{},"tag":"h2","children":["Checkpointing"],"type":"node"},{"attributes":{},"tag":"p","children":["Use the ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.Checkpointer"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["Checkpointer"],"type":"node"}],"type":"node"}," callback to create model checkpoints after every epoch."],"type":"node"},{"attributes":{},"tag":"h2","children":["Early Stopping"],"type":"node"},{"attributes":{},"tag":"p","children":["Use ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.EarlyStopping"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["EarlyStopping"],"type":"node"}],"type":"node"}," to stop when a stopping criterion is met. Supports all criteria in ",{"attributes":{"href":"https://github.com/ablaom/EarlyStopping.jl","title":""},"tag":"a","children":["EarlyStopping.jl"],"type":"node"},"."],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file diff --git a/data/FluxTraining@dev/doc/docs/getting_started.md.json b/data/FluxTraining@dev/doc/docs/getting_started.md.json index 4e39e478e..8339c5836 100644 --- a/data/FluxTraining@dev/doc/docs/getting_started.md.json +++ b/data/FluxTraining@dev/doc/docs/getting_started.md.json @@ -1 +1 @@ -{"attributes":{"backlinks":[{"tag":"document","title":"FluxTraining.jl","docid":"FluxTraining@dev/doc/README.md"}],"path":"/home/runner/.julia/packages/FluxTraining/xCOPx/docs/getting_started.md","title":"Getting started"},"tag":"document","children":[{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"h1","children":["Getting started"],"type":"node"},{"attributes":{},"tag":"p","children":["Let's look at a simple training example. In ",{"attributes":{},"tag":"em","children":["FluxTraining.jl"],"type":"node"},", a ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.Learner"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["Learner"],"type":"node"}],"type":"node"}," holds all state necessary for training. To get started, you need"],"type":"node"},{"attributes":{},"tag":"ul","children":[{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["a ",{"attributes":{"href":"/doc/docs/background/model.md","title":"","document_id":"FluxTraining@dev/doc/docs/background/model.md"},"tag":"reference","children":["model"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["training and validation ",{"attributes":{"href":"/doc/docs/background/dataiterator.md","title":"","document_id":"FluxTraining@dev/doc/docs/background/dataiterator.md"},"tag":"reference","children":["data iterators"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["a ",{"attributes":{"href":"/doc/docs/background/lossfunction.md","title":"","document_id":"FluxTraining@dev/doc/docs/background/lossfunction.md"},"tag":"reference","children":["loss function"],"type":"node"},"; and"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["an ",{"attributes":{"href":"/doc/docs/background/optimizer.md","title":"","document_id":"FluxTraining@dev/doc/docs/background/optimizer.md"},"tag":"reference","children":["optimizer"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"p","children":["First we define the necessary pieces:"],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":["model = ...\ntraindata, valdata = ...\nlossfn = Flux.Losses.mse\nopt = Flux.ADAM(0.01)"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"p","children":["Then we construct a ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.Learner"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["Learner"],"type":"node"}],"type":"node"},":"],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Learner"},"tag":"reference","children":["Learner"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["lossfn"],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["traindata"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["valdata"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"p","children":["And train for 10 epochs:"],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.fit!"},"tag":"reference","children":["fit!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["10"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file +{"attributes":{"backlinks":[{"tag":"document","title":"FluxTraining.jl","docid":"FluxTraining@dev/doc/README.md"}],"path":"/home/runner/.julia/packages/FluxTraining/imTF4/docs/getting_started.md","title":"Getting started"},"tag":"document","children":[{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"h1","children":["Getting started"],"type":"node"},{"attributes":{},"tag":"p","children":["Let's look at a simple training example. In ",{"attributes":{},"tag":"em","children":["FluxTraining.jl"],"type":"node"},", a ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.Learner"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["Learner"],"type":"node"}],"type":"node"}," holds all state necessary for training. To get started, you need"],"type":"node"},{"attributes":{},"tag":"ul","children":[{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["a ",{"attributes":{"href":"/doc/docs/background/model.md","title":"","document_id":"FluxTraining@dev/doc/docs/background/model.md"},"tag":"reference","children":["model"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["training and validation ",{"attributes":{"href":"/doc/docs/background/dataiterator.md","title":"","document_id":"FluxTraining@dev/doc/docs/background/dataiterator.md"},"tag":"reference","children":["data iterators"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["a ",{"attributes":{"href":"/doc/docs/background/lossfunction.md","title":"","document_id":"FluxTraining@dev/doc/docs/background/lossfunction.md"},"tag":"reference","children":["loss function"],"type":"node"},"; and"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["an ",{"attributes":{"href":"/doc/docs/background/optimizer.md","title":"","document_id":"FluxTraining@dev/doc/docs/background/optimizer.md"},"tag":"reference","children":["optimizer"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"p","children":["First we define the necessary pieces:"],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":["model = ...\ntraindata, valdata = ...\nlossfn = Flux.Losses.mse\nopt = Flux.ADAM(0.01)"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"p","children":["Then we construct a ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.Learner"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["Learner"],"type":"node"}],"type":"node"},":"],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Learner"},"tag":"reference","children":["Learner"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["lossfn"],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["traindata"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["valdata"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"p","children":["And train for 10 epochs:"],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.fit!"},"tag":"reference","children":["fit!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["10"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file diff --git a/data/FluxTraining@dev/doc/docs/imagenette_demo.ipynb.json b/data/FluxTraining@dev/doc/docs/imagenette_demo.ipynb.json index 9809aac0e..b395dbda9 100644 --- a/data/FluxTraining@dev/doc/docs/imagenette_demo.ipynb.json +++ b/data/FluxTraining@dev/doc/docs/imagenette_demo.ipynb.json @@ -1 +1 @@ -{"attributes":{"backlinks":[],"path":"/home/runner/.julia/packages/FluxTraining/xCOPx/docs/imagenette_demo.ipynb","title":"imagenette_demo"},"tag":"document","children":[{"attributes":{"nbformat":[4,4],"kernelspec":{"display_name":"Julia (12 threads) 1.5.0","language":"julia","name":"julia-(12-threads)-1.5"},"language_info":{"file_extension":".jl","mimetype":"application/julia","name":"julia","version":"1.5.0"}},"tag":"jupyter","children":[{"attributes":{"id":null,"execution_count":null},"tag":"codecell","children":[{"attributes":{},"tag":"codeinput","children":[{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["DataLoaders"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Flux"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["DataAugmentation"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["DeepLearningTasks"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["DLDatasets"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["MLDataPattern"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["LearnBase"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ProgressBars"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["FluxTraining"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["FluxModels"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{"id":null,"execution_count":2},"tag":"codecell","children":[{"attributes":{},"tag":"codeinput","children":[{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["task"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["ImageClassification"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Integer","children":["10"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["sz"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Integer","children":["224"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["224"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["labeltoint"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["metadata"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ImageNette"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["labeltoclass"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["obsfn"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["image"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["label"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["image"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":"Identifier","children":["labeltoint"],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["label"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"coderesult","children":[{"attributes":{},"tag":"codeblock","children":[{"mimes":{"text/html":"obsfn (generic function with 1 method)"},"type":"leaf"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{"id":null,"execution_count":3},"tag":"codecell","children":[{"attributes":{},"tag":"codeinput","children":[{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"Identifier","children":["trainds"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["valds"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["DLDatasets"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["loaddataset"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ImageNette"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["v2_160px"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["split"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["train"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["val"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["bs"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["64"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["traindl"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["taskdataloader"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["task"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["trainds"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["bs"],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["obsfn"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"toplevel","children":[{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["valdl"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["taskdataloader"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["task"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["valds"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Integer","children":["2"],"type":"node"},{"attributes":{},"tag":"*","children":[""],"type":"node"},{"attributes":{},"tag":"Identifier","children":["bs"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["obsfn"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":";","children":[";"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{"id":null,"execution_count":4},"tag":"codecell","children":[{"attributes":{},"tag":"codeinput","children":[{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"toplevel","children":[{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["gpu"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["Chain"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["xresnet18"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["FluxModels"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["classificationhead"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["task"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["nclasses"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["512"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":";","children":[";"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{"id":null,"execution_count":15},"tag":"codecell","children":[{"attributes":{},"tag":"codeinput","children":[{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"toplevel","children":[{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Learner"},"tag":"reference","children":["Learner"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["traindl"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["valdl"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["ADAM"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Flux"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["Losses"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["logitcrossentropy"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"vect","children":[{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ToGPU"},"tag":"reference","children":["ToGPU"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["metrics"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"vect","children":[{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Metric"},"tag":"reference","children":["Metric"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.accuracy"},"tag":"reference","children":["accuracy"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["schedule"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["Schedules"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["onecycleschedule"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Integer","children":["10"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"*","children":["*"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["length"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["traindl"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Float","children":["0.01"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":";","children":[";"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{"id":null,"execution_count":16},"tag":"codecell","children":[{"attributes":{},"tag":"codeinput","children":[{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["FluxTraining"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.fit!"},"tag":"reference","children":["fit!"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["10"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"codeoutput","children":[{"attributes":{},"tag":"codeblock","children":[{"mimes":{"text/html":"Epoch 1 TrainingPhase(): 100%|██████████████████████████| Time: 0:01:02\nloss: 1.3166474935148849\naccuracy: 0.5757865646258504\nEpoch 2 ValidationPhase(): 100%|████████████████████████| Time: 0:00:13\nloss: 1.9421841899553935\naccuracy: 0.471875\nEpoch 2 TrainingPhase(): 100%|██████████████████████████| Time: 0:01:05\nloss: 1.001848922700298\naccuracy: 0.678146258503401\nEpoch 3 ValidationPhase(): 100%|████████████████████████| Time: 0:00:13\nloss: 1.044497122367223\naccuracy: 0.6622395833333337\nEpoch 3 TrainingPhase(): 100%|██████████████████████████| Time: 0:01:06\nloss: 0.8365915733940748\naccuracy: 0.7292729591836736\nEpoch 4 ValidationPhase(): 100%|████████████████████████| Time: 0:00:13\nloss: 0.9936108271280925\naccuracy: 0.6783854166666666\nEpoch 4 TrainingPhase(): 100%|██████████████████████████| Time: 0:01:04\nloss: 0.7450118934621617\naccuracy: 0.7589285714285718\nEpoch 5 ValidationPhase(): 100%|████████████████████████| Time: 0:00:13\nloss: 1.0524701436360677\naccuracy: 0.6640625000000001\nEpoch 5 TrainingPhase(): 100%|██████████████████████████| Time: 0:01:05\nloss: 0.6489803444366066\naccuracy: 0.7909226190476191\nEpoch 6 ValidationPhase(): 100%|████████████████████████| Time: 0:00:12\nloss: 0.8496215959390004\naccuracy: 0.7190104166666665\nEpoch 6 TrainingPhase(): 100%|██████████████████████████| Time: 0:01:06\nloss: 0.5658585832637995\naccuracy: 0.8167517006802718\nEpoch 7 ValidationPhase(): 100%|████████████████████████| Time: 0:00:13\nloss: 0.7595664302508036\naccuracy: 0.7575520833333333\nEpoch 7 TrainingPhase(): 100%|██████████████████████████| Time: 0:01:05\nloss: 0.5101636230540113\naccuracy: 0.8338647959183668\nEpoch 8 ValidationPhase(): 100%|████████████████████████| Time: 0:00:12\nloss: 0.8600163320700328\naccuracy: 0.7414062499999998\nEpoch 8 TrainingPhase(): 100%|██████████████████████████| Time: 0:01:05\nloss: 0.45264889228911626\naccuracy: 0.8527848639455782\nEpoch 9 ValidationPhase(): 100%|████████████████████████| Time: 0:00:13\nloss: 0.8109628856182098\naccuracy: 0.753125\nEpoch 9 TrainingPhase(): 100%|██████████████████████████| Time: 0:01:05\nloss: 0.40744140095451253\naccuracy: 0.8603316326530616\nEpoch 10 ValidationPhase(): 100%|███████████████████████| Time: 0:00:12\nloss: 0.6673034459352494\naccuracy: 0.7921874999999999\nEpoch 10 TrainingPhase(): 100%|█████████████████████████| Time: 0:01:04\nloss: 0.3401108379063963\naccuracy: 0.885841836734694\nEpoch 11 ValidationPhase(): 100%|███████████████████████| Time: 0:00:12\nloss: 0.7720626552899679\naccuracy: 0.7669270833333333\n"},"type":"leaf"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"coderesult","children":[{"attributes":{},"tag":"codeblock","children":[{"mimes":{"text/html":"Learner\n model: Chain{Tuple{Chain{Tuple{Chain{Tuple{Conv{2,4,typeof(identity),CUDA.CuArray{Float32,4},CUDA.CuArray{Float32,1}},BatchNorm{typeof(relu),CUDA.CuArray{Float32,1},CUDA.CuArray{Float32,1},Float32}}},Chain{Tuple{Conv{2,4,typeof(identity),CUDA.CuArray{Float32,4},CUDA.CuArray{Float32,1}},BatchNorm{typeof(relu),CUDA.CuArray{Float32,1},CUDA.CuArray{Float32,1},Float32}}},Chain{Tuple{Conv{2,4,typeof(identity),CUDA.CuArray{Float32,4},CUDA.CuArray{Float32,1}},BatchNorm{typeof(relu),CUDA.CuArray{Float32,1},CUDA.CuArray{Float32,1},Float32}}},MaxPool{2,4},Chain{Tuple{FluxModels.ResBlock,FluxModels.ResBlock}},Chain{Tuple{FluxModels.ResBlock,FluxModels.ResBlock}},Chain{Tuple{FluxModels.ResBlock,FluxModels.ResBlock}},Chain{Tuple{FluxModels.ResBlock,FluxModels.ResBlock}}}},Chain{Tuple{FluxModels.AdaptiveMeanPool{2},typeof(FluxModels.flatten),Dense{typeof(identity),CUDA.CuArray{Float32,2},CUDA.CuArray{Float32,1}}}}}}\n data: Tuple{DataLoaders.BufferGetObsParallel{Tuple{Array{Float32,4},Array{Float32,2}},DataLoaders.BatchViewCollated{DeepLearningTasks.MappedData}},DataLoaders.BufferGetObsParallel{Tuple{Array{Float32,4},Array{Float32,2}},DataLoaders.BatchViewCollated{DeepLearningTasks.MappedData}}}\n opt: ADAM\n lossfn: logitcrossentropy (function of type typeof(Flux.Losses.logitcrossentropy))\n params: Zygote.Params\n batch: FluxTraining.BatchState\n callbacks: FluxTraining.Callbacks\n cbstate: Dict{Symbol,Any}\n"},"type":"leaf"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file +{"attributes":{"backlinks":[],"path":"/home/runner/.julia/packages/FluxTraining/imTF4/docs/imagenette_demo.ipynb","title":"imagenette_demo"},"tag":"document","children":[{"attributes":{"nbformat":[4,4],"kernelspec":{"display_name":"Julia (12 threads) 1.5.0","language":"julia","name":"julia-(12-threads)-1.5"},"language_info":{"file_extension":".jl","mimetype":"application/julia","name":"julia","version":"1.5.0"}},"tag":"jupyter","children":[{"attributes":{"id":null,"execution_count":null},"tag":"codecell","children":[{"attributes":{},"tag":"codeinput","children":[{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["DataLoaders"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Flux"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["DataAugmentation"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["DeepLearningTasks"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["DLDatasets"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["MLDataPattern"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["LearnBase"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ProgressBars"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["FluxTraining"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["FluxModels"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{"id":null,"execution_count":2},"tag":"codecell","children":[{"attributes":{},"tag":"codeinput","children":[{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["task"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["ImageClassification"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Integer","children":["10"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["sz"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Integer","children":["224"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["224"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["labeltoint"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["metadata"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ImageNette"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["labeltoclass"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["obsfn"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["image"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["label"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["image"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":"Identifier","children":["labeltoint"],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["label"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"coderesult","children":[{"attributes":{},"tag":"codeblock","children":[{"mimes":{"text/html":"obsfn (generic function with 1 method)"},"type":"leaf"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{"id":null,"execution_count":3},"tag":"codecell","children":[{"attributes":{},"tag":"codeinput","children":[{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"Identifier","children":["trainds"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["valds"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["DLDatasets"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["loaddataset"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ImageNette"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["v2_160px"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["split"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["train"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["val"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["bs"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["64"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["traindl"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["taskdataloader"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["task"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["trainds"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["bs"],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["obsfn"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"toplevel","children":[{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["valdl"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["taskdataloader"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["task"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["valds"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Integer","children":["2"],"type":"node"},{"attributes":{},"tag":"*","children":[""],"type":"node"},{"attributes":{},"tag":"Identifier","children":["bs"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["obsfn"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":";","children":[";"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{"id":null,"execution_count":4},"tag":"codecell","children":[{"attributes":{},"tag":"codeinput","children":[{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"toplevel","children":[{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["gpu"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["Chain"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["xresnet18"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["FluxModels"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["classificationhead"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["task"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["nclasses"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["512"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":";","children":[";"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{"id":null,"execution_count":15},"tag":"codecell","children":[{"attributes":{},"tag":"codeinput","children":[{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"toplevel","children":[{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Learner"},"tag":"reference","children":["Learner"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["traindl"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["valdl"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["ADAM"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Flux"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["Losses"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["logitcrossentropy"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"vect","children":[{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ToGPU"},"tag":"reference","children":["ToGPU"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["metrics"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"vect","children":[{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Metric"},"tag":"reference","children":["Metric"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.accuracy"},"tag":"reference","children":["accuracy"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["schedule"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["Schedules"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["onecycleschedule"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Integer","children":["10"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"*","children":["*"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["length"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["traindl"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Float","children":["0.01"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":";","children":[";"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{"id":null,"execution_count":16},"tag":"codecell","children":[{"attributes":{},"tag":"codeinput","children":[{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["FluxTraining"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.fit!"},"tag":"reference","children":["fit!"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["10"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"codeoutput","children":[{"attributes":{},"tag":"codeblock","children":[{"mimes":{"text/html":"Epoch 1 TrainingPhase(): 100%|██████████████████████████| Time: 0:01:02\nloss: 1.3166474935148849\naccuracy: 0.5757865646258504\nEpoch 2 ValidationPhase(): 100%|████████████████████████| Time: 0:00:13\nloss: 1.9421841899553935\naccuracy: 0.471875\nEpoch 2 TrainingPhase(): 100%|██████████████████████████| Time: 0:01:05\nloss: 1.001848922700298\naccuracy: 0.678146258503401\nEpoch 3 ValidationPhase(): 100%|████████████████████████| Time: 0:00:13\nloss: 1.044497122367223\naccuracy: 0.6622395833333337\nEpoch 3 TrainingPhase(): 100%|██████████████████████████| Time: 0:01:06\nloss: 0.8365915733940748\naccuracy: 0.7292729591836736\nEpoch 4 ValidationPhase(): 100%|████████████████████████| Time: 0:00:13\nloss: 0.9936108271280925\naccuracy: 0.6783854166666666\nEpoch 4 TrainingPhase(): 100%|██████████████████████████| Time: 0:01:04\nloss: 0.7450118934621617\naccuracy: 0.7589285714285718\nEpoch 5 ValidationPhase(): 100%|████████████████████████| Time: 0:00:13\nloss: 1.0524701436360677\naccuracy: 0.6640625000000001\nEpoch 5 TrainingPhase(): 100%|██████████████████████████| Time: 0:01:05\nloss: 0.6489803444366066\naccuracy: 0.7909226190476191\nEpoch 6 ValidationPhase(): 100%|████████████████████████| Time: 0:00:12\nloss: 0.8496215959390004\naccuracy: 0.7190104166666665\nEpoch 6 TrainingPhase(): 100%|██████████████████████████| Time: 0:01:06\nloss: 0.5658585832637995\naccuracy: 0.8167517006802718\nEpoch 7 ValidationPhase(): 100%|████████████████████████| Time: 0:00:13\nloss: 0.7595664302508036\naccuracy: 0.7575520833333333\nEpoch 7 TrainingPhase(): 100%|██████████████████████████| Time: 0:01:05\nloss: 0.5101636230540113\naccuracy: 0.8338647959183668\nEpoch 8 ValidationPhase(): 100%|████████████████████████| Time: 0:00:12\nloss: 0.8600163320700328\naccuracy: 0.7414062499999998\nEpoch 8 TrainingPhase(): 100%|██████████████████████████| Time: 0:01:05\nloss: 0.45264889228911626\naccuracy: 0.8527848639455782\nEpoch 9 ValidationPhase(): 100%|████████████████████████| Time: 0:00:13\nloss: 0.8109628856182098\naccuracy: 0.753125\nEpoch 9 TrainingPhase(): 100%|██████████████████████████| Time: 0:01:05\nloss: 0.40744140095451253\naccuracy: 0.8603316326530616\nEpoch 10 ValidationPhase(): 100%|███████████████████████| Time: 0:00:12\nloss: 0.6673034459352494\naccuracy: 0.7921874999999999\nEpoch 10 TrainingPhase(): 100%|█████████████████████████| Time: 0:01:04\nloss: 0.3401108379063963\naccuracy: 0.885841836734694\nEpoch 11 ValidationPhase(): 100%|███████████████████████| Time: 0:00:12\nloss: 0.7720626552899679\naccuracy: 0.7669270833333333\n"},"type":"leaf"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"coderesult","children":[{"attributes":{},"tag":"codeblock","children":[{"mimes":{"text/html":"Learner\n model: Chain{Tuple{Chain{Tuple{Chain{Tuple{Conv{2,4,typeof(identity),CUDA.CuArray{Float32,4},CUDA.CuArray{Float32,1}},BatchNorm{typeof(relu),CUDA.CuArray{Float32,1},CUDA.CuArray{Float32,1},Float32}}},Chain{Tuple{Conv{2,4,typeof(identity),CUDA.CuArray{Float32,4},CUDA.CuArray{Float32,1}},BatchNorm{typeof(relu),CUDA.CuArray{Float32,1},CUDA.CuArray{Float32,1},Float32}}},Chain{Tuple{Conv{2,4,typeof(identity),CUDA.CuArray{Float32,4},CUDA.CuArray{Float32,1}},BatchNorm{typeof(relu),CUDA.CuArray{Float32,1},CUDA.CuArray{Float32,1},Float32}}},MaxPool{2,4},Chain{Tuple{FluxModels.ResBlock,FluxModels.ResBlock}},Chain{Tuple{FluxModels.ResBlock,FluxModels.ResBlock}},Chain{Tuple{FluxModels.ResBlock,FluxModels.ResBlock}},Chain{Tuple{FluxModels.ResBlock,FluxModels.ResBlock}}}},Chain{Tuple{FluxModels.AdaptiveMeanPool{2},typeof(FluxModels.flatten),Dense{typeof(identity),CUDA.CuArray{Float32,2},CUDA.CuArray{Float32,1}}}}}}\n data: Tuple{DataLoaders.BufferGetObsParallel{Tuple{Array{Float32,4},Array{Float32,2}},DataLoaders.BatchViewCollated{DeepLearningTasks.MappedData}},DataLoaders.BufferGetObsParallel{Tuple{Array{Float32,4},Array{Float32,2}},DataLoaders.BatchViewCollated{DeepLearningTasks.MappedData}}}\n opt: ADAM\n lossfn: logitcrossentropy (function of type typeof(Flux.Losses.logitcrossentropy))\n params: Zygote.Params\n batch: FluxTraining.BatchState\n callbacks: FluxTraining.Callbacks\n cbstate: Dict{Symbol,Any}\n"},"type":"leaf"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file diff --git a/data/FluxTraining@dev/doc/docs/overview.md.json b/data/FluxTraining@dev/doc/docs/overview.md.json index d6891e432..154cd4127 100644 --- a/data/FluxTraining@dev/doc/docs/overview.md.json +++ b/data/FluxTraining@dev/doc/docs/overview.md.json @@ -1 +1 @@ -{"attributes":{"backlinks":[],"path":"/home/runner/.julia/packages/FluxTraining/xCOPx/docs/overview.md","title":"Getting started"},"tag":"document","children":[{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"h1","children":["Getting started"],"type":"node"},{"attributes":{},"tag":"ul","children":[{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["There are some user-centric tutorials that will introduce you to features of ",{"attributes":{},"tag":"em","children":["FluxTraining.jl"],"type":"node"}," one at a time"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["Alternatively you can read more about how ",{"attributes":{},"tag":"em","children":["FluxTraining.jl"],"type":"node"}," is implemented and how you can extend it"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"h2","children":["Tutorials"],"type":"node"},{"attributes":{},"tag":"ul","children":[{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":[{"attributes":{"href":"./tutorials/mnist.ipynb","title":"","document_id":"FluxTraining@dev/doc/docs/tutorials/mnist.ipynb"},"tag":"reference","children":["MNIST training"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":[{"attributes":{"href":"./tutorials/hyperparameters.md","title":"","document_id":"FluxTraining@dev/doc/docs/tutorials/hyperparameters.md"},"tag":"reference","children":["Hyperparameter scheduling"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"h2","children":["Interfaces"],"type":"node"},{"attributes":{},"tag":"h3","children":["Training loop"],"type":"node"},{"attributes":{},"tag":"p","children":["Find out how ",{"attributes":{"href":"training/basics.md","title":"","document_id":"FluxTraining@dev/doc/docs/training/basics.md"},"tag":"reference","children":["the training loop"],"type":"node"}," is built and how to customize it."],"type":"node"},{"attributes":{},"tag":"h3","children":["Callbacks"],"type":"node"},{"attributes":{},"tag":"p","children":["Callbacks are a powerful feature of ",{"attributes":{},"tag":"em","children":["FluxTraining.jl"],"type":"node"},", allowing you to add functionality to the training loop at different points."],"type":"node"},{"attributes":{},"tag":"p","children":["Find out"],"type":"node"},{"attributes":{},"tag":"ul","children":[{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["how to ",{"attributes":{"href":"./callbacks/usage.md","title":"","document_id":"FluxTraining@dev/doc/docs/callbacks/usage.md"},"tag":"reference","children":["use callbacks"],"type":"node"}," when training"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["what callbacks come ",{"attributes":{"href":"./callbacks/reference.md","title":"","document_id":"FluxTraining@dev/doc/docs/callbacks/reference.md"},"tag":"reference","children":["included with ",{"attributes":{},"tag":"em","children":["FluxTraining.jl"],"type":"node"}],"type":"node"},"; or"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["how callbacks work and how to ",{"attributes":{"href":"./callbacks/custom.md","title":"","document_id":"FluxTraining@dev/doc/docs/callbacks/custom.md"},"tag":"reference","children":["implement your own"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file +{"attributes":{"backlinks":[],"path":"/home/runner/.julia/packages/FluxTraining/imTF4/docs/overview.md","title":"Getting started"},"tag":"document","children":[{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"h1","children":["Getting started"],"type":"node"},{"attributes":{},"tag":"ul","children":[{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["There are some user-centric tutorials that will introduce you to features of ",{"attributes":{},"tag":"em","children":["FluxTraining.jl"],"type":"node"}," one at a time"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["Alternatively you can read more about how ",{"attributes":{},"tag":"em","children":["FluxTraining.jl"],"type":"node"}," is implemented and how you can extend it"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"h2","children":["Tutorials"],"type":"node"},{"attributes":{},"tag":"ul","children":[{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":[{"attributes":{"href":"./tutorials/mnist.ipynb","title":"","document_id":"FluxTraining@dev/doc/docs/tutorials/mnist.ipynb"},"tag":"reference","children":["MNIST training"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":[{"attributes":{"href":"./tutorials/hyperparameters.md","title":"","document_id":"FluxTraining@dev/doc/docs/tutorials/hyperparameters.md"},"tag":"reference","children":["Hyperparameter scheduling"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"h2","children":["Interfaces"],"type":"node"},{"attributes":{},"tag":"h3","children":["Training loop"],"type":"node"},{"attributes":{},"tag":"p","children":["Find out how ",{"attributes":{"href":"training/basics.md","title":"","document_id":"FluxTraining@dev/doc/docs/training/basics.md"},"tag":"reference","children":["the training loop"],"type":"node"}," is built and how to customize it."],"type":"node"},{"attributes":{},"tag":"h3","children":["Callbacks"],"type":"node"},{"attributes":{},"tag":"p","children":["Callbacks are a powerful feature of ",{"attributes":{},"tag":"em","children":["FluxTraining.jl"],"type":"node"},", allowing you to add functionality to the training loop at different points."],"type":"node"},{"attributes":{},"tag":"p","children":["Find out"],"type":"node"},{"attributes":{},"tag":"ul","children":[{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["how to ",{"attributes":{"href":"./callbacks/usage.md","title":"","document_id":"FluxTraining@dev/doc/docs/callbacks/usage.md"},"tag":"reference","children":["use callbacks"],"type":"node"}," when training"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["what callbacks come ",{"attributes":{"href":"./callbacks/reference.md","title":"","document_id":"FluxTraining@dev/doc/docs/callbacks/reference.md"},"tag":"reference","children":["included with ",{"attributes":{},"tag":"em","children":["FluxTraining.jl"],"type":"node"}],"type":"node"},"; or"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["how callbacks work and how to ",{"attributes":{"href":"./callbacks/custom.md","title":"","document_id":"FluxTraining@dev/doc/docs/callbacks/custom.md"},"tag":"reference","children":["implement your own"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file diff --git a/data/FluxTraining@dev/doc/docs/reference/training.md.json b/data/FluxTraining@dev/doc/docs/reference/training.md.json index 97fb68d01..930dec808 100644 --- a/data/FluxTraining@dev/doc/docs/reference/training.md.json +++ b/data/FluxTraining@dev/doc/docs/reference/training.md.json @@ -1 +1 @@ -{"attributes":{"backlinks":[{"tag":"document","title":"News","docid":"FluxTraining@dev/doc/CHANGELOG.md"}],"path":"/home/runner/.julia/packages/FluxTraining/xCOPx/docs/reference/training.md","title":"Training loop API reference"},"tag":"document","children":[{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"h1","children":["Training loop API reference"],"type":"node"},{"attributes":{},"tag":"p","children":["The training loop API centers around the abstract type ",{"attributes":{"href":"#","title":""},"tag":"a","children":[{"attributes":{},"tag":"code","children":["Phase"],"type":"node"}],"type":"node"}," and the function ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.step!"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["step!"],"type":"node"}],"type":"node"},". To ",{"attributes":{"href":"../tutorials/training.md","title":"","document_id":"FluxTraining@dev/doc/docs/tutorials/training.md"},"tag":"reference","children":["implement a custom training"],"type":"node"},", you need to"],"type":"node"},{"attributes":{},"tag":"h2","children":["Usage"],"type":"node"},{"attributes":{},"tag":"ul","children":[{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["fit for ",{"attributes":{},"tag":"code","children":["n"],"type":"node"}," epochs of supervised training and validation using ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.fit!"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["fit!"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"code","children":["(learner, n)"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["train for an epoch using ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.epoch!"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["epoch!"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"code","children":["(learner, phase, dataiter)"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"h2","children":["Extending"],"type":"node"},{"attributes":{},"tag":"ul","children":[{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["subtype ",{"attributes":{"href":"#","title":""},"tag":"a","children":[{"attributes":{},"tag":"code","children":["Phase"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["implement ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.step!"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["step!"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"p","children":["You can optionally"],"type":"node"},{"attributes":{},"tag":"ul","children":[{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["overwrite default ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.epoch!"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["epoch!"],"type":"node"}],"type":"node"}," implementation"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["implement ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.phasedataiter"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["phasedataiter"],"type":"node"}],"type":"node"}," to define which data iterator should be used when ",{"attributes":{},"tag":"code","children":["epoch!"],"type":"node"}," is called without one."],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["create custom ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.Callback"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["Callback"],"type":"node"}],"type":"node"}," and ",{"attributes":{"href":"#","title":""},"tag":"a","children":[{"attributes":{},"tag":"code","children":["Event"],"type":"node"}],"type":"node"},"s with event handlers that dispatch on your ",{"attributes":{},"tag":"code","children":["Phase"],"type":"node"}," subtype."],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"h3","children":["Control flow"],"type":"node"},{"attributes":{},"tag":"p","children":["Inside callback handlers and ",{"attributes":{},"tag":"code","children":["step!"],"type":"node"}," implementations, you can throw ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.CancelFittingException"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["CancelFittingException"],"type":"node"}],"type":"node"}," to stop the training and ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.CancelEpochException"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["CancelEpochException"],"type":"node"}],"type":"node"}," and ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.CancelStepException"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["CancelStepException"],"type":"node"}],"type":"node"}," to skip the current epoch or step."],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file +{"attributes":{"backlinks":[{"tag":"document","title":"News","docid":"FluxTraining@dev/doc/CHANGELOG.md"}],"path":"/home/runner/.julia/packages/FluxTraining/imTF4/docs/reference/training.md","title":"Training loop API reference"},"tag":"document","children":[{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"h1","children":["Training loop API reference"],"type":"node"},{"attributes":{},"tag":"p","children":["The training loop API centers around the abstract type ",{"attributes":{"href":"#","title":""},"tag":"a","children":[{"attributes":{},"tag":"code","children":["Phase"],"type":"node"}],"type":"node"}," and the function ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.step!"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["step!"],"type":"node"}],"type":"node"},". To ",{"attributes":{"href":"../tutorials/training.md","title":"","document_id":"FluxTraining@dev/doc/docs/tutorials/training.md"},"tag":"reference","children":["implement a custom training"],"type":"node"},", you need to"],"type":"node"},{"attributes":{},"tag":"h2","children":["Usage"],"type":"node"},{"attributes":{},"tag":"ul","children":[{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["fit for ",{"attributes":{},"tag":"code","children":["n"],"type":"node"}," epochs of supervised training and validation using ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.fit!"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["fit!"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"code","children":["(learner, n)"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["train for an epoch using ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.epoch!"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["epoch!"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"code","children":["(learner, phase, dataiter)"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"h2","children":["Extending"],"type":"node"},{"attributes":{},"tag":"ul","children":[{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["subtype ",{"attributes":{"href":"#","title":""},"tag":"a","children":[{"attributes":{},"tag":"code","children":["Phase"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["implement ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.step!"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["step!"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"p","children":["You can optionally"],"type":"node"},{"attributes":{},"tag":"ul","children":[{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["overwrite default ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.epoch!"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["epoch!"],"type":"node"}],"type":"node"}," implementation"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["implement ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.phasedataiter"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["phasedataiter"],"type":"node"}],"type":"node"}," to define which data iterator should be used when ",{"attributes":{},"tag":"code","children":["epoch!"],"type":"node"}," is called without one."],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["create custom ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.Callback"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["Callback"],"type":"node"}],"type":"node"}," and ",{"attributes":{"href":"#","title":""},"tag":"a","children":[{"attributes":{},"tag":"code","children":["Event"],"type":"node"}],"type":"node"},"s with event handlers that dispatch on your ",{"attributes":{},"tag":"code","children":["Phase"],"type":"node"}," subtype."],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"h3","children":["Control flow"],"type":"node"},{"attributes":{},"tag":"p","children":["Inside callback handlers and ",{"attributes":{},"tag":"code","children":["step!"],"type":"node"}," implementations, you can throw ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.CancelFittingException"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["CancelFittingException"],"type":"node"}],"type":"node"}," to stop the training and ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.CancelEpochException"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["CancelEpochException"],"type":"node"}],"type":"node"}," and ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.CancelStepException"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["CancelStepException"],"type":"node"}],"type":"node"}," to skip the current epoch or step."],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file diff --git a/data/FluxTraining@dev/doc/docs/tutorials/hyperparameters.md.json b/data/FluxTraining@dev/doc/docs/tutorials/hyperparameters.md.json index cc26d47fc..fd750ed12 100644 --- a/data/FluxTraining@dev/doc/docs/tutorials/hyperparameters.md.json +++ b/data/FluxTraining@dev/doc/docs/tutorials/hyperparameters.md.json @@ -1 +1 @@ -{"attributes":{"backlinks":[{"tag":"document","title":"Getting started","docid":"FluxTraining@dev/doc/docs/overview.md"},{"tag":"document","title":"Features","docid":"FluxTraining@dev/doc/docs/features.md"}],"path":"/home/runner/.julia/packages/FluxTraining/xCOPx/docs/tutorials/hyperparameters.md","title":"Hyperparameter scheduling"},"tag":"document","children":[{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"h1","children":["Hyperparameter scheduling"],"type":"node"},{"attributes":{},"tag":"p","children":["When training neural networks, you often have to tune hyperparameters."],"type":"node"},{"attributes":{},"tag":"p","children":["In ",{"attributes":{},"tag":"em","children":["FluxTraining.jl"],"type":"node"}," the following definition is used:"],"type":"node"},{"attributes":{},"tag":"blockquote","children":[{"attributes":{},"tag":"p","children":[{"attributes":{},"tag":"em","children":["A hyperparameter is any state that influences the training and is not a parameter of the model."],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"p","children":["Common hyperparameters to worry about are the learning rate, batch size and regularization strength."],"type":"node"},{"attributes":{},"tag":"p","children":["In recent years, it has also become common practice to schedule some hyperparameters. The cyclical learning rate schedule introduced in ",{"attributes":{"href":"https://arxiv.org/abs/1506.01186","title":""},"tag":"a","children":["L. Smith 2015"],"type":"node"},", for example, changes the learning rate every step to speed up convergence."],"type":"node"},{"attributes":{},"tag":"p","children":[{"attributes":{},"tag":"em","children":["FluxTraining.jl"],"type":"node"}," provides an extensible interface for hyperparameter scheduling that is not restricted to optimizer hyperparameters as in many other training frameworks. To use it, you have to create a ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.Scheduler"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["Scheduler"],"type":"node"}],"type":"node"},", a callback that can be passed to a ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.Learner"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["Learner"],"type":"node"}],"type":"node"},"."],"type":"node"},{"attributes":{},"tag":"p","children":[{"attributes":{},"tag":"code","children":["Scheduler"],"type":"node"},"'s constructor takes pairs of hyperparameter types and associated schedules."],"type":"node"},{"attributes":{},"tag":"p","children":["As an example"],"type":"node"},{"attributes":{},"tag":"ul","children":[{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":[{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.LearningRate"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["LearningRate"],"type":"node"}],"type":"node"}," is a hyperparameter type representing the optimizer's step size; and"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":[{"attributes":{},"tag":"code","children":["schedule = Exp(γ=0.9)"],"type":"node"}," represents an exponential decay scheduling"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"p","children":["We can create the callback scheduling the learning rate according to ",{"attributes":{},"tag":"code","children":["Scheduler(LearningRate => schedule)"],"type":"node"},"."],"type":"node"},{"attributes":{},"tag":"p","children":[{"attributes":{},"tag":"code","children":["Schedule"],"type":"node"},"s are built around ",{"attributes":{"href":"https://github.com/FluxML/ParameterSchedulers.jl","title":""},"tag":"a","children":[{"attributes":{},"tag":"em","children":["ParameterSchedulers.jl"],"type":"node"}],"type":"node"},". See that package's documentation for more details on how to construct them."],"type":"node"},{"attributes":{},"tag":"h3","children":["One-cycle learning rate"],"type":"node"},{"attributes":{},"tag":"p","children":["Let's define a ",{"attributes":{},"tag":"code","children":["Schedule"],"type":"node"}," that follows the above-mentioned cyclical learning rate schedule."],"type":"node"},{"attributes":{},"tag":"p","children":["The idea is to start with a small learning rate, gradually increase it, and then slowly decrease it again."],"type":"node"},{"attributes":{},"tag":"p","children":["For example, we could start with a learning rate of 0.01, increase it to 0.1 over 3 epochs, and then down to 0.001 over 7 epochs. Let's also use cosine annealing, a common practice that makes sure the values are interpolated more smoothly."],"type":"node"},{"attributes":{},"tag":"p","children":["In code, that looks like this:"],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":":","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ParameterSchedulers"],"type":"node"}],"type":"node"},{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Shifted"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Sin"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Comment","children":["# for cosine annealing"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["es"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["length"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["traindl"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Comment","children":["# number of steps in an epoch"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["schedule"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["Sequence"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["Sin"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["λ0"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Float","children":["0.01"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Comment","children":["# initial learning rate"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["λ1"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Float","children":["0.1"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Comment","children":["# max learning rate"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["period"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Integer","children":["2"],"type":"node"},{"attributes":{},"tag":"*","children":["*"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Integer","children":["3"],"type":"node"},{"attributes":{},"tag":"*","children":[""],"type":"node"},{"attributes":{},"tag":"Identifier","children":["es"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Comment","children":["#"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=>","children":["=>"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["3"],"type":"node"},{"attributes":{},"tag":"*","children":[""],"type":"node"},{"attributes":{},"tag":"Identifier","children":["es"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["Shifted"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["Sin"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["λ0"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Float","children":["0.1"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Comment","children":["# max learning rate"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["λ1"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Float","children":["0.001"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Comment","children":["# end learning rate"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["period"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Integer","children":["2"],"type":"node"},{"attributes":{},"tag":"*","children":["*"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Integer","children":["7"],"type":"node"},{"attributes":{},"tag":"*","children":[""],"type":"node"},{"attributes":{},"tag":"Identifier","children":["es"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":[" \n "],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Integer","children":["7"],"type":"node"},{"attributes":{},"tag":"*","children":[""],"type":"node"},{"attributes":{},"tag":"Identifier","children":["es"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"+","children":["+"],"type":"node"},{"attributes":{},"tag":"Integer","children":["1"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=>","children":["=>"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["7"],"type":"node"},{"attributes":{},"tag":"*","children":[""],"type":"node"},{"attributes":{},"tag":"Identifier","children":["es"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["opt"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["lossfn"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Scheduler"},"tag":"reference","children":["Scheduler"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.LearningRate"},"tag":"reference","children":["LearningRate"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=>","children":["=>"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["schedule"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"p","children":["For convenience, you can also use the ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.onecycle"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["onecycle"],"type":"node"}],"type":"node"}," helper to create this ",{"attributes":{},"tag":"code","children":["Schedule"],"type":"node"},". See ",{"attributes":{"href":"https://fluxml.ai/ParameterSchedulers.jl/dev/docs/tutorials/warmup-schedules.html","title":""},"tag":"a","children":["ParameterSchedulers.jl documentation"],"type":"node"}," for more details on warm-up schedules."],"type":"node"},{"attributes":{},"tag":"h2","children":["Extending"],"type":"node"},{"attributes":{},"tag":"p","children":["You can create and schedule your own hyperparameters."],"type":"node"},{"attributes":{},"tag":"p","children":["To do this, you will need to define"],"type":"node"},{"attributes":{},"tag":"ul","children":[{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["a type for your hyperparameter, e.g. ",{"attributes":{},"tag":"code","children":["abstract type MyParam <: HyperParameter end"],"type":"node"},","],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["how to set the hyperparameter by implementing ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.sethyperparameter!"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["sethyperparameter!"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"code","children":["(learner, ::Type{MyParam}, value)"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["what state needs to be accessed to set the hyperparameter by implementing ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.stateaccess"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["stateaccess"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"code","children":["(::Type{MyParam})"],"type":"node"},". See ",{"attributes":{"href":"../callbacks/custom.md","title":"","document_id":"FluxTraining@dev/doc/docs/callbacks/custom.md"},"tag":"reference","children":["custom callbacks"],"type":"node"}," for more info on why this is needed."],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{"class":"info"},"tag":"admonition","children":[{"attributes":{},"tag":"admonitiontitle","children":["Kinds of hyperparameters"],"type":"node"},{"attributes":{},"tag":"admonitionbody","children":[{"attributes":{},"tag":"p","children":["Hyperparameters don't need to belong to the optimizer! For example, you could create a hyperparameter for batch size. That is not implemented here because this package is agnostic of the data iterators and the implementation would differ for every type of iterator."],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file +{"attributes":{"backlinks":[{"tag":"document","title":"Getting started","docid":"FluxTraining@dev/doc/docs/overview.md"},{"tag":"document","title":"Features","docid":"FluxTraining@dev/doc/docs/features.md"}],"path":"/home/runner/.julia/packages/FluxTraining/imTF4/docs/tutorials/hyperparameters.md","title":"Hyperparameter scheduling"},"tag":"document","children":[{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"h1","children":["Hyperparameter scheduling"],"type":"node"},{"attributes":{},"tag":"p","children":["When training neural networks, you often have to tune hyperparameters."],"type":"node"},{"attributes":{},"tag":"p","children":["In ",{"attributes":{},"tag":"em","children":["FluxTraining.jl"],"type":"node"}," the following definition is used:"],"type":"node"},{"attributes":{},"tag":"blockquote","children":[{"attributes":{},"tag":"p","children":[{"attributes":{},"tag":"em","children":["A hyperparameter is any state that influences the training and is not a parameter of the model."],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"p","children":["Common hyperparameters to worry about are the learning rate, batch size and regularization strength."],"type":"node"},{"attributes":{},"tag":"p","children":["In recent years, it has also become common practice to schedule some hyperparameters. The cyclical learning rate schedule introduced in ",{"attributes":{"href":"https://arxiv.org/abs/1506.01186","title":""},"tag":"a","children":["L. Smith 2015"],"type":"node"},", for example, changes the learning rate every step to speed up convergence."],"type":"node"},{"attributes":{},"tag":"p","children":[{"attributes":{},"tag":"em","children":["FluxTraining.jl"],"type":"node"}," provides an extensible interface for hyperparameter scheduling that is not restricted to optimizer hyperparameters as in many other training frameworks. To use it, you have to create a ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.Scheduler"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["Scheduler"],"type":"node"}],"type":"node"},", a callback that can be passed to a ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.Learner"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["Learner"],"type":"node"}],"type":"node"},"."],"type":"node"},{"attributes":{},"tag":"p","children":[{"attributes":{},"tag":"code","children":["Scheduler"],"type":"node"},"'s constructor takes pairs of hyperparameter types and associated schedules."],"type":"node"},{"attributes":{},"tag":"p","children":["As an example"],"type":"node"},{"attributes":{},"tag":"ul","children":[{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":[{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.LearningRate"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["LearningRate"],"type":"node"}],"type":"node"}," is a hyperparameter type representing the optimizer's step size; and"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":[{"attributes":{},"tag":"code","children":["schedule = Exp(γ=0.9)"],"type":"node"}," represents an exponential decay scheduling"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"p","children":["We can create the callback scheduling the learning rate according to ",{"attributes":{},"tag":"code","children":["Scheduler(LearningRate => schedule)"],"type":"node"},"."],"type":"node"},{"attributes":{},"tag":"p","children":[{"attributes":{},"tag":"code","children":["Schedule"],"type":"node"},"s are built around ",{"attributes":{"href":"https://github.com/FluxML/ParameterSchedulers.jl","title":""},"tag":"a","children":[{"attributes":{},"tag":"em","children":["ParameterSchedulers.jl"],"type":"node"}],"type":"node"},". See that package's documentation for more details on how to construct them."],"type":"node"},{"attributes":{},"tag":"h3","children":["One-cycle learning rate"],"type":"node"},{"attributes":{},"tag":"p","children":["Let's define a ",{"attributes":{},"tag":"code","children":["Schedule"],"type":"node"}," that follows the above-mentioned cyclical learning rate schedule."],"type":"node"},{"attributes":{},"tag":"p","children":["The idea is to start with a small learning rate, gradually increase it, and then slowly decrease it again."],"type":"node"},{"attributes":{},"tag":"p","children":["For example, we could start with a learning rate of 0.01, increase it to 0.1 over 3 epochs, and then down to 0.001 over 7 epochs. Let's also use cosine annealing, a common practice that makes sure the values are interpolated more smoothly."],"type":"node"},{"attributes":{},"tag":"p","children":["In code, that looks like this:"],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":":","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ParameterSchedulers"],"type":"node"}],"type":"node"},{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Shifted"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Sin"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Comment","children":["# for cosine annealing"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["es"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["length"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["traindl"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Comment","children":["# number of steps in an epoch"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["schedule"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["Sequence"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["Sin"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["λ0"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Float","children":["0.01"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Comment","children":["# initial learning rate"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["λ1"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Float","children":["0.1"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Comment","children":["# max learning rate"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["period"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Integer","children":["2"],"type":"node"},{"attributes":{},"tag":"*","children":["*"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Integer","children":["3"],"type":"node"},{"attributes":{},"tag":"*","children":[""],"type":"node"},{"attributes":{},"tag":"Identifier","children":["es"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Comment","children":["#"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=>","children":["=>"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["3"],"type":"node"},{"attributes":{},"tag":"*","children":[""],"type":"node"},{"attributes":{},"tag":"Identifier","children":["es"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["Shifted"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["Sin"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["λ0"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Float","children":["0.1"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Comment","children":["# max learning rate"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["λ1"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Float","children":["0.001"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Comment","children":["# end learning rate"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["period"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Integer","children":["2"],"type":"node"},{"attributes":{},"tag":"*","children":["*"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Integer","children":["7"],"type":"node"},{"attributes":{},"tag":"*","children":[""],"type":"node"},{"attributes":{},"tag":"Identifier","children":["es"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":[" \n "],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Integer","children":["7"],"type":"node"},{"attributes":{},"tag":"*","children":[""],"type":"node"},{"attributes":{},"tag":"Identifier","children":["es"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"+","children":["+"],"type":"node"},{"attributes":{},"tag":"Integer","children":["1"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=>","children":["=>"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["7"],"type":"node"},{"attributes":{},"tag":"*","children":[""],"type":"node"},{"attributes":{},"tag":"Identifier","children":["es"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["opt"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["lossfn"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Scheduler"},"tag":"reference","children":["Scheduler"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.LearningRate"},"tag":"reference","children":["LearningRate"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=>","children":["=>"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["schedule"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"p","children":["For convenience, you can also use the ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.onecycle"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["onecycle"],"type":"node"}],"type":"node"}," helper to create this ",{"attributes":{},"tag":"code","children":["Schedule"],"type":"node"},". See ",{"attributes":{"href":"https://fluxml.ai/ParameterSchedulers.jl/dev/docs/tutorials/warmup-schedules.html","title":""},"tag":"a","children":["ParameterSchedulers.jl documentation"],"type":"node"}," for more details on warm-up schedules."],"type":"node"},{"attributes":{},"tag":"h2","children":["Extending"],"type":"node"},{"attributes":{},"tag":"p","children":["You can create and schedule your own hyperparameters."],"type":"node"},{"attributes":{},"tag":"p","children":["To do this, you will need to define"],"type":"node"},{"attributes":{},"tag":"ul","children":[{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["a type for your hyperparameter, e.g. ",{"attributes":{},"tag":"code","children":["abstract type MyParam <: HyperParameter end"],"type":"node"},","],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["how to set the hyperparameter by implementing ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.sethyperparameter!"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["sethyperparameter!"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"code","children":["(learner, ::Type{MyParam}, value)"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["what state needs to be accessed to set the hyperparameter by implementing ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.stateaccess"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["stateaccess"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"code","children":["(::Type{MyParam})"],"type":"node"},". See ",{"attributes":{"href":"../callbacks/custom.md","title":"","document_id":"FluxTraining@dev/doc/docs/callbacks/custom.md"},"tag":"reference","children":["custom callbacks"],"type":"node"}," for more info on why this is needed."],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{"class":"info"},"tag":"admonition","children":[{"attributes":{},"tag":"admonitiontitle","children":["Kinds of hyperparameters"],"type":"node"},{"attributes":{},"tag":"admonitionbody","children":[{"attributes":{},"tag":"p","children":["Hyperparameters don't need to belong to the optimizer! For example, you could create a hyperparameter for batch size. That is not implemented here because this package is agnostic of the data iterators and the implementation would differ for every type of iterator."],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file diff --git a/data/FluxTraining@dev/doc/docs/tutorials/mnist.ipynb.json b/data/FluxTraining@dev/doc/docs/tutorials/mnist.ipynb.json index 2a6e6fda7..8ca8c95ca 100644 --- a/data/FluxTraining@dev/doc/docs/tutorials/mnist.ipynb.json +++ b/data/FluxTraining@dev/doc/docs/tutorials/mnist.ipynb.json @@ -1 +1 @@ -{"attributes":{"backlinks":[{"tag":"document","title":"Getting started","docid":"FluxTraining@dev/doc/docs/overview.md"},{"tag":"document","title":"Data iterators","docid":"FluxTraining@dev/doc/docs/background/dataiterator.md"},{"tag":"document","title":"FluxTraining.jl","docid":"FluxTraining@dev/doc/README.md"}],"path":"/home/runner/.julia/packages/FluxTraining/xCOPx/docs/tutorials/mnist.ipynb","title":"Training an image classifier"},"tag":"document","children":[{"attributes":{"nbformat":[4,4],"kernelspec":{"display_name":"Julia 1.7.3","language":"julia","name":"julia-1.7"},"language_info":{"file_extension":".jl","mimetype":"application/julia","name":"julia","version":"1.7.3"}},"tag":"jupyter","children":[{"attributes":{"id":null},"tag":"md","children":[{"attributes":{},"tag":"h1","children":["Training an image classifier"],"type":"node"}],"type":"node"},{"attributes":{"id":null},"tag":"md","children":[{"attributes":{},"tag":"p","children":["Let's put ",{"attributes":{},"tag":"em","children":["FluxTraining.jl"],"type":"node"}," to train a model on the MNIST dataset."],"type":"node"},{"attributes":{},"tag":"p","children":["MNIST is simple enough that we can focus on the part where ",{"attributes":{},"tag":"em","children":["FluxTraining.jl"],"type":"node"}," comes in, the training. If you want to see examples of using FluxTraining.jl on larger datasets, see the documentation of ",{"attributes":{"href":"https://github.com/FluxML/FastAI.jl","title":""},"tag":"a","children":["FastAI.jl"],"type":"node"},"."],"type":"node"}],"type":"node"},{"attributes":{"id":null},"tag":"md","children":[{"attributes":{},"tag":"h2","children":["Setup"],"type":"node"}],"type":"node"},{"attributes":{"id":null},"tag":"md","children":[{"attributes":{},"tag":"p","children":[{"attributes":{},"tag":"em","children":["If you want to run this tutorial yourself, you can find the notebook file ",{"attributes":{"href":"https://github.com/lorenzoh/FluxTraining.jl/blob/master/docs/tutorials/mnist.ipynb","title":""},"tag":"a","children":["here"],"type":"node"}],"type":"node"},"."],"type":"node"}],"type":"node"},{"attributes":{"id":null},"tag":"md","children":[{"attributes":{},"tag":"p","children":["To make data loading and batching a bit easier, we'll install an additional dependency:"],"type":"node"}],"type":"node"},{"attributes":{"id":null},"tag":"md","children":[{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"toplevel","children":[{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Pkg"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Pkg"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["add"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"vect","children":[{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["MLUtils"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{"id":null},"tag":"md","children":[{"attributes":{},"tag":"p","children":["Now we can import everything we'll need."],"type":"node"}],"type":"node"},{"attributes":{"id":null,"execution_count":9},"tag":"codecell","children":[{"attributes":{},"tag":"codeinput","children":[{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":":","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["MLUtils"],"type":"node"}],"type":"node"},{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["splitobs"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["unsqueeze"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":":","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["MLDatasets"],"type":"node"}],"type":"node"},{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["MNIST"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Flux"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":":","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Flux"],"type":"node"}],"type":"node"},{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["onehotbatch"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":":","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Flux"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Data"],"type":"node"}],"type":"node"},{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["DataLoader"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["FluxTraining"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{"id":null},"tag":"md","children":[{"attributes":{},"tag":"h2","children":["Overview"],"type":"node"}],"type":"node"},{"attributes":{"id":null},"tag":"md","children":[{"attributes":{},"tag":"p","children":["There are 4 pieces that you always need to construct and train a ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.Learner"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["Learner"],"type":"node"}],"type":"node"},":"],"type":"node"},{"attributes":{},"tag":"ul","children":[{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["a model"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["data"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["an optimizer; and"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["a loss function"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{"id":null},"tag":"md","children":[{"attributes":{},"tag":"h2","children":["Building a ",{"attributes":{},"tag":"code","children":["Learner"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{"id":null},"tag":"md","children":[{"attributes":{},"tag":"p","children":["Let's look at the ",{"attributes":{},"tag":"strong","children":["data"],"type":"node"}," first."],"type":"node"},{"attributes":{},"tag":"p","children":[{"attributes":{},"tag":"em","children":["FluxTraining.jl"],"type":"node"}," is agnostic of the data source. The only requirements are:"],"type":"node"},{"attributes":{},"tag":"ul","children":[{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["it is iterable and each iteration returns a tuple ",{"attributes":{},"tag":"code","children":["(xs, ys)"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["the model can take in ",{"attributes":{},"tag":"code","children":["xs"],"type":"node"},", i.e. ",{"attributes":{},"tag":"code","children":["model(xs)"],"type":"node"}," works; and"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["the loss function can take model outputs and ",{"attributes":{},"tag":"code","children":["ys"],"type":"node"},", i.e. ",{"attributes":{},"tag":"code","children":["lossfn(model(xs), ys)"],"type":"node"}," returns a scalar"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{"id":null},"tag":"md","children":[{"attributes":{},"tag":"p","children":["Glossing over the details as it's not the focus of this tutorial, here's the code for getting a data iterator of the MNIST dataset. We use ",{"attributes":{},"tag":"code","children":["DataLoaders.DataLoader"],"type":"node"}," to create an iterator of batches from our dataset."],"type":"node"}],"type":"node"},{"attributes":{"id":null,"execution_count":10},"tag":"codecell","children":[{"attributes":{},"tag":"codeinput","children":[{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["MNIST"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["train"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"const","children":[{"attributes":{},"tag":"const","children":["const"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["LABELS"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["0"],"type":"node"},{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Integer","children":["9"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"Comment","children":["# unsqueeze to reshape from (28, 28, numobs) to (28, 28, 1, numobs)"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["preprocess"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["targets"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["unsqueeze"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["3"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["onehotbatch"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["targets"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["LABELS"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"Comment","children":["# traindata and testdata contain both inputs (pixel values) and targets (correct labels)"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["traindata"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["MNIST"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Float32"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["train"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"|>","children":["|>"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["preprocess"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["testdata"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["MNIST"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Float32"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["test"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"|>","children":["|>"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["preprocess"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"toplevel","children":[{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"Comment","children":["# create iterators"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"Identifier","children":["trainiter"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["testiter"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["DataLoader"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["traindata"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["batchsize"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Integer","children":["128"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["DataLoader"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["testdata"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["batchsize"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Integer","children":["256"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":";","children":[";"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{"id":null},"tag":"md","children":[{"attributes":{},"tag":"p","children":["Next, let's create a simple ",{"attributes":{},"tag":"em","children":["Flux.jl"],"type":"node"}," ",{"attributes":{},"tag":"strong","children":["model"],"type":"node"}," that we'll train to classify the MNIST digits."],"type":"node"}],"type":"node"},{"attributes":{"id":null,"execution_count":11},"tag":"codecell","children":[{"attributes":{},"tag":"codeinput","children":[{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["Chain"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["Conv"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Integer","children":["3"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["3"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Integer","children":["1"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=>","children":["=>"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["16"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["relu"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["pad"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["1"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["stride"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["2"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["Conv"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Integer","children":["3"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["3"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Integer","children":["16"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=>","children":["=>"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["32"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["relu"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["pad"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["1"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["GlobalMeanPool"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Flux"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["flatten"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["Dense"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Integer","children":["32"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["10"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"coderesult","children":[{"attributes":{},"tag":"codeblock","children":[{"mimes":{"text/html":"Chain(\n Conv((3, 3), 1 => 16, relu, pad=1, stride=2), # 160 parameters\n Conv((3, 3), 16 => 32, relu, pad=1), # 4_640 parameters\n GlobalMeanPool(),\n Flux.flatten,\n Dense(32 => 10), # 330 parameters\n) # Total: 6 arrays, 5_130 parameters, 20.867 KiB."},"type":"leaf"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{"id":null},"tag":"md","children":[{"attributes":{},"tag":"p","children":["We'll use ",{"attributes":{},"tag":"em","children":["categorical cross entropy"],"type":"node"}," as a ",{"attributes":{},"tag":"strong","children":["loss function"],"type":"node"}," and ",{"attributes":{},"tag":"em","children":["ADAM"],"type":"node"}," as an ",{"attributes":{},"tag":"strong","children":["optimizer"],"type":"node"},"."],"type":"node"}],"type":"node"},{"attributes":{"id":null,"execution_count":12},"tag":"codecell","children":[{"attributes":{},"tag":"codeinput","children":[{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["lossfn"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Flux"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["Losses"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["logitcrossentropy"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"toplevel","children":[{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["optimizer"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Flux"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["ADAM"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":";","children":[";"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{"id":null},"tag":"md","children":[{"attributes":{},"tag":"p","children":["Now we're ready to create a ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.Learner"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["Learner"],"type":"node"}],"type":"node"},". At this point you can also add any callbacks, like ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.ToGPU"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["ToGPU"],"type":"node"}],"type":"node"}," to run the training on your GPU if you have one available. Some callbacks are also ",{"attributes":{"href":"../callbacks/reference.md","title":"","document_id":"FluxTraining@dev/doc/docs/callbacks/reference.md"},"tag":"reference","children":["included by default"],"type":"node"},"."],"type":"node"},{"attributes":{},"tag":"p","children":["Since we're classifying digits, we also use the ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.Metrics"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["Metrics"],"type":"node"}],"type":"node"}," callback to track the accuracy of the model's predictions:"],"type":"node"}],"type":"node"},{"attributes":{"id":null,"execution_count":13},"tag":"codecell","children":[{"attributes":{},"tag":"codeinput","children":[{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Learner"},"tag":"reference","children":["Learner"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["lossfn"],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"vect","children":[{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ToGPU"},"tag":"reference","children":["ToGPU"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Metrics"},"tag":"reference","children":["Metrics"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.accuracy"},"tag":"reference","children":["accuracy"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["optimizer"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"coderesult","children":[{"attributes":{},"tag":"codeblock","children":[{"mimes":{"text/html":"Learner()"},"type":"leaf"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{"id":null},"tag":"md","children":[{"attributes":{},"tag":"h2","children":["Training"],"type":"node"}],"type":"node"},{"attributes":{"id":null},"tag":"md","children":[{"attributes":{},"tag":"p","children":["With a ",{"attributes":{},"tag":"code","children":["Learner"],"type":"node"}," in place, training is as simple as calling ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.fit!"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["fit!"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"code","children":["(learner, nepochs, dataiters)"],"type":"node"},"."],"type":"node"}],"type":"node"},{"attributes":{"id":null,"execution_count":14},"tag":"codecell","children":[{"attributes":{},"tag":"codeinput","children":[{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["FluxTraining"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.fit!"},"tag":"reference","children":["fit!"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["10"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["trainiter"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["testiter"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"codeoutput","children":[{"attributes":{},"tag":"codeblock","children":[{"mimes":{"text/html":"Epoch 1 TrainingPhase() ...\n┌───────────────┬───────┬─────────┬──────────┐\n│ Phase Epoch Loss Accuracy │\n├───────────────┼───────┼─────────┼──────────┤\n│ TrainingPhase │ 1.0 │ 1.92511 │ 0.30643 │\n└───────────────┴───────┴─────────┴──────────┘\nEpoch 1 ValidationPhase() ...\n┌─────────────────┬───────┬─────────┬──────────┐\n│ Phase Epoch Loss Accuracy │\n├─────────────────┼───────┼─────────┼──────────┤\n│ ValidationPhase │ 1.0 │ 1.56384 │ 0.429 │\n└─────────────────┴───────┴─────────┴──────────┘\nEpoch 2 TrainingPhase() ...\n┌───────────────┬───────┬─────────┬──────────┐\n│ Phase Epoch Loss Accuracy │\n├───────────────┼───────┼─────────┼──────────┤\n│ TrainingPhase │ 2.0 │ 1.40887 │ 0.53872 │\n└───────────────┴───────┴─────────┴──────────┘\nEpoch 2 ValidationPhase() ...\n┌─────────────────┬───────┬─────────┬──────────┐\n│ Phase Epoch Loss Accuracy │\n├─────────────────┼───────┼─────────┼──────────┤\n│ ValidationPhase │ 2.0 │ 1.25592 │ 0.57578 │\n└─────────────────┴───────┴─────────┴──────────┘\nEpoch 3 TrainingPhase() ...\n┌───────────────┬───────┬─────────┬──────────┐\n│ Phase Epoch Loss Accuracy │\n├───────────────┼───────┼─────────┼──────────┤\n│ TrainingPhase │ 3.0 │ 1.17799 │ 0.64023 │\n└───────────────┴───────┴─────────┴──────────┘\nEpoch 3 ValidationPhase() ...\n┌─────────────────┬───────┬────────┬──────────┐\n│ Phase Epoch Loss Accuracy │\n├─────────────────┼───────┼────────┼──────────┤\n│ ValidationPhase │ 3.0 │ 1.0728 │ 0.63809 │\n└─────────────────┴───────┴────────┴──────────┘\nEpoch 4 TrainingPhase() ...\n┌───────────────┬───────┬─────────┬──────────┐\n│ Phase Epoch Loss Accuracy │\n├───────────────┼───────┼─────────┼──────────┤\n│ TrainingPhase │ 4.0 │ 1.02755 │ 0.69311 │\n└───────────────┴───────┴─────────┴──────────┘\nEpoch 4 ValidationPhase() ...\n┌─────────────────┬───────┬─────────┬──────────┐\n│ Phase Epoch Loss Accuracy │\n├─────────────────┼───────┼─────────┼──────────┤\n│ ValidationPhase │ 4.0 │ 0.95165 │ 0.67871 │\n└─────────────────┴───────┴─────────┴──────────┘\nEpoch 5 TrainingPhase() ...\n┌───────────────┬───────┬─────────┬──────────┐\n│ Phase Epoch Loss Accuracy │\n├───────────────┼───────┼─────────┼──────────┤\n│ TrainingPhase │ 5.0 │ 0.91992 │ 0.72615 │\n└───────────────┴───────┴─────────┴──────────┘\nEpoch 5 ValidationPhase() ...\n┌─────────────────┬───────┬─────────┬──────────┐\n│ Phase Epoch Loss Accuracy │\n├─────────────────┼───────┼─────────┼──────────┤\n│ ValidationPhase │ 5.0 │ 0.86318 │ 0.70791 │\n└─────────────────┴───────┴─────────┴──────────┘\nEpoch 6 TrainingPhase() ...\n┌───────────────┬───────┬─────────┬──────────┐\n│ Phase Epoch Loss Accuracy │\n├───────────────┼───────┼─────────┼──────────┤\n│ TrainingPhase │ 6.0 │ 0.83481 │ 0.75419 │\n└───────────────┴───────┴─────────┴──────────┘\nEpoch 6 ValidationPhase() ...\n┌─────────────────┬───────┬─────────┬──────────┐\n│ Phase Epoch Loss Accuracy │\n├─────────────────┼───────┼─────────┼──────────┤\n│ ValidationPhase │ 6.0 │ 0.79026 │ 0.73604 │\n└─────────────────┴───────┴─────────┴──────────┘\nEpoch 7 TrainingPhase() ...\n┌───────────────┬───────┬────────┬──────────┐\n│ Phase Epoch Loss Accuracy │\n├───────────────┼───────┼────────┼──────────┤\n│ TrainingPhase │ 7.0 │ 0.7636 │ 0.77762 │\n└───────────────┴───────┴────────┴──────────┘\nEpoch 7 ValidationPhase() ...\n┌─────────────────┬───────┬─────────┬──────────┐\n│ Phase Epoch Loss Accuracy │\n├─────────────────┼───────┼─────────┼──────────┤\n│ ValidationPhase │ 7.0 │ 0.72974 │ 0.75869 │\n└─────────────────┴───────┴─────────┴──────────┘\nEpoch 8 TrainingPhase() ...\n┌───────────────┬───────┬─────────┬──────────┐\n│ Phase Epoch Loss Accuracy │\n├───────────────┼───────┼─────────┼──────────┤\n│ TrainingPhase │ 8.0 │ 0.70309 │ 0.79626 │\n└───────────────┴───────┴─────────┴──────────┘\nEpoch 8 ValidationPhase() ...\n┌─────────────────┬───────┬────────┬──────────┐\n│ Phase Epoch Loss Accuracy │\n├─────────────────┼───────┼────────┼──────────┤\n│ ValidationPhase │ 8.0 │ 0.6784 │ 0.77363 │\n└─────────────────┴───────┴────────┴──────────┘\nEpoch 9 TrainingPhase() ...\n┌───────────────┬───────┬─────────┬──────────┐\n│ Phase Epoch Loss Accuracy │\n├───────────────┼───────┼─────────┼──────────┤\n│ TrainingPhase │ 9.0 │ 0.65131 │ 0.81166 │\n└───────────────┴───────┴─────────┴──────────┘\nEpoch 9 ValidationPhase() ...\n┌─────────────────┬───────┬─────────┬──────────┐\n│ Phase Epoch Loss Accuracy │\n├─────────────────┼───────┼─────────┼──────────┤\n│ ValidationPhase │ 9.0 │ 0.63317 │ 0.79014 │\n└─────────────────┴───────┴─────────┴──────────┘\nEpoch 10 TrainingPhase() ...\n┌───────────────┬───────┬─────────┬──────────┐\n│ Phase Epoch Loss Accuracy │\n├───────────────┼───────┼─────────┼──────────┤\n│ TrainingPhase │ 10.0 │ 0.60669 │ 0.82449 │\n└───────────────┴───────┴─────────┴──────────┘\nEpoch 10 ValidationPhase() ...\n┌─────────────────┬───────┬─────────┬──────────┐\n│ Phase Epoch Loss Accuracy │\n├─────────────────┼───────┼─────────┼──────────┤\n│ ValidationPhase │ 10.0 │ 0.59359 │ 0.80527 │\n└─────────────────┴───────┴─────────┴──────────┘\n"},"type":"leaf"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{"id":null,"execution_count":null},"tag":"codecell","children":[{"attributes":{},"tag":"codeinput","children":[{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file +{"attributes":{"backlinks":[{"tag":"document","title":"Getting started","docid":"FluxTraining@dev/doc/docs/overview.md"},{"tag":"document","title":"Data iterators","docid":"FluxTraining@dev/doc/docs/background/dataiterator.md"},{"tag":"document","title":"FluxTraining.jl","docid":"FluxTraining@dev/doc/README.md"}],"path":"/home/runner/.julia/packages/FluxTraining/imTF4/docs/tutorials/mnist.ipynb","title":"Training an image classifier"},"tag":"document","children":[{"attributes":{"nbformat":[4,4],"kernelspec":{"display_name":"Julia 1.7.3","language":"julia","name":"julia-1.7"},"language_info":{"file_extension":".jl","mimetype":"application/julia","name":"julia","version":"1.7.3"}},"tag":"jupyter","children":[{"attributes":{"id":null},"tag":"md","children":[{"attributes":{},"tag":"h1","children":["Training an image classifier"],"type":"node"}],"type":"node"},{"attributes":{"id":null},"tag":"md","children":[{"attributes":{},"tag":"p","children":["Let's put ",{"attributes":{},"tag":"em","children":["FluxTraining.jl"],"type":"node"}," to train a model on the MNIST dataset."],"type":"node"},{"attributes":{},"tag":"p","children":["MNIST is simple enough that we can focus on the part where ",{"attributes":{},"tag":"em","children":["FluxTraining.jl"],"type":"node"}," comes in, the training. If you want to see examples of using FluxTraining.jl on larger datasets, see the documentation of ",{"attributes":{"href":"https://github.com/FluxML/FastAI.jl","title":""},"tag":"a","children":["FastAI.jl"],"type":"node"},"."],"type":"node"}],"type":"node"},{"attributes":{"id":null},"tag":"md","children":[{"attributes":{},"tag":"h2","children":["Setup"],"type":"node"}],"type":"node"},{"attributes":{"id":null},"tag":"md","children":[{"attributes":{},"tag":"p","children":[{"attributes":{},"tag":"em","children":["If you want to run this tutorial yourself, you can find the notebook file ",{"attributes":{"href":"https://github.com/lorenzoh/FluxTraining.jl/blob/master/docs/tutorials/mnist.ipynb","title":""},"tag":"a","children":["here"],"type":"node"}],"type":"node"},"."],"type":"node"}],"type":"node"},{"attributes":{"id":null},"tag":"md","children":[{"attributes":{},"tag":"p","children":["To make data loading and batching a bit easier, we'll install an additional dependency:"],"type":"node"}],"type":"node"},{"attributes":{"id":null},"tag":"md","children":[{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"toplevel","children":[{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Pkg"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Pkg"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["add"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"vect","children":[{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["MLUtils"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{"id":null},"tag":"md","children":[{"attributes":{},"tag":"p","children":["Now we can import everything we'll need."],"type":"node"}],"type":"node"},{"attributes":{"id":null,"execution_count":9},"tag":"codecell","children":[{"attributes":{},"tag":"codeinput","children":[{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":":","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["MLUtils"],"type":"node"}],"type":"node"},{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["splitobs"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["unsqueeze"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":":","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["MLDatasets"],"type":"node"}],"type":"node"},{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["MNIST"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Flux"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":":","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Flux"],"type":"node"}],"type":"node"},{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["onehotbatch"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":":","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Flux"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Data"],"type":"node"}],"type":"node"},{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["DataLoader"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["FluxTraining"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{"id":null},"tag":"md","children":[{"attributes":{},"tag":"h2","children":["Overview"],"type":"node"}],"type":"node"},{"attributes":{"id":null},"tag":"md","children":[{"attributes":{},"tag":"p","children":["There are 4 pieces that you always need to construct and train a ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.Learner"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["Learner"],"type":"node"}],"type":"node"},":"],"type":"node"},{"attributes":{},"tag":"ul","children":[{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["a model"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["data"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["an optimizer; and"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["a loss function"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{"id":null},"tag":"md","children":[{"attributes":{},"tag":"h2","children":["Building a ",{"attributes":{},"tag":"code","children":["Learner"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{"id":null},"tag":"md","children":[{"attributes":{},"tag":"p","children":["Let's look at the ",{"attributes":{},"tag":"strong","children":["data"],"type":"node"}," first."],"type":"node"},{"attributes":{},"tag":"p","children":[{"attributes":{},"tag":"em","children":["FluxTraining.jl"],"type":"node"}," is agnostic of the data source. The only requirements are:"],"type":"node"},{"attributes":{},"tag":"ul","children":[{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["it is iterable and each iteration returns a tuple ",{"attributes":{},"tag":"code","children":["(xs, ys)"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["the model can take in ",{"attributes":{},"tag":"code","children":["xs"],"type":"node"},", i.e. ",{"attributes":{},"tag":"code","children":["model(xs)"],"type":"node"}," works; and"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["the loss function can take model outputs and ",{"attributes":{},"tag":"code","children":["ys"],"type":"node"},", i.e. ",{"attributes":{},"tag":"code","children":["lossfn(model(xs), ys)"],"type":"node"}," returns a scalar"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{"id":null},"tag":"md","children":[{"attributes":{},"tag":"p","children":["Glossing over the details as it's not the focus of this tutorial, here's the code for getting a data iterator of the MNIST dataset. We use ",{"attributes":{},"tag":"code","children":["DataLoaders.DataLoader"],"type":"node"}," to create an iterator of batches from our dataset."],"type":"node"}],"type":"node"},{"attributes":{"id":null,"execution_count":10},"tag":"codecell","children":[{"attributes":{},"tag":"codeinput","children":[{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["MNIST"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["train"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"const","children":[{"attributes":{},"tag":"const","children":["const"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["LABELS"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["0"],"type":"node"},{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Integer","children":["9"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"Comment","children":["# unsqueeze to reshape from (28, 28, numobs) to (28, 28, 1, numobs)"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["preprocess"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["targets"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["unsqueeze"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["3"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["onehotbatch"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["targets"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["LABELS"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"Comment","children":["# traindata and testdata contain both inputs (pixel values) and targets (correct labels)"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["traindata"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["MNIST"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Float32"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["train"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"|>","children":["|>"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["preprocess"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["testdata"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["MNIST"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Float32"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["test"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"|>","children":["|>"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["preprocess"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"toplevel","children":[{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"Comment","children":["# create iterators"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"Identifier","children":["trainiter"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["testiter"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["DataLoader"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["traindata"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["batchsize"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Integer","children":["128"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["DataLoader"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["testdata"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["batchsize"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Integer","children":["256"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":";","children":[";"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{"id":null},"tag":"md","children":[{"attributes":{},"tag":"p","children":["Next, let's create a simple ",{"attributes":{},"tag":"em","children":["Flux.jl"],"type":"node"}," ",{"attributes":{},"tag":"strong","children":["model"],"type":"node"}," that we'll train to classify the MNIST digits."],"type":"node"}],"type":"node"},{"attributes":{"id":null,"execution_count":11},"tag":"codecell","children":[{"attributes":{},"tag":"codeinput","children":[{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["Chain"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["Conv"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Integer","children":["3"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["3"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Integer","children":["1"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=>","children":["=>"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["16"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["relu"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["pad"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["1"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["stride"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["2"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["Conv"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Integer","children":["3"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["3"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Integer","children":["16"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=>","children":["=>"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["32"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["relu"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["pad"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["1"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["GlobalMeanPool"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Flux"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["flatten"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["Dense"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Integer","children":["32"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["10"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"coderesult","children":[{"attributes":{},"tag":"codeblock","children":[{"mimes":{"text/html":"Chain(\n Conv((3, 3), 1 => 16, relu, pad=1, stride=2), # 160 parameters\n Conv((3, 3), 16 => 32, relu, pad=1), # 4_640 parameters\n GlobalMeanPool(),\n Flux.flatten,\n Dense(32 => 10), # 330 parameters\n) # Total: 6 arrays, 5_130 parameters, 20.867 KiB."},"type":"leaf"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{"id":null},"tag":"md","children":[{"attributes":{},"tag":"p","children":["We'll use ",{"attributes":{},"tag":"em","children":["categorical cross entropy"],"type":"node"}," as a ",{"attributes":{},"tag":"strong","children":["loss function"],"type":"node"}," and ",{"attributes":{},"tag":"em","children":["ADAM"],"type":"node"}," as an ",{"attributes":{},"tag":"strong","children":["optimizer"],"type":"node"},"."],"type":"node"}],"type":"node"},{"attributes":{"id":null,"execution_count":12},"tag":"codecell","children":[{"attributes":{},"tag":"codeinput","children":[{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["lossfn"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Flux"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["Losses"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["logitcrossentropy"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"toplevel","children":[{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["optimizer"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Flux"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["ADAM"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":";","children":[";"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{"id":null},"tag":"md","children":[{"attributes":{},"tag":"p","children":["Now we're ready to create a ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.Learner"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["Learner"],"type":"node"}],"type":"node"},". At this point you can also add any callbacks, like ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.ToGPU"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["ToGPU"],"type":"node"}],"type":"node"}," to run the training on your GPU if you have one available. Some callbacks are also ",{"attributes":{"href":"../callbacks/reference.md","title":"","document_id":"FluxTraining@dev/doc/docs/callbacks/reference.md"},"tag":"reference","children":["included by default"],"type":"node"},"."],"type":"node"},{"attributes":{},"tag":"p","children":["Since we're classifying digits, we also use the ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.Metrics"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["Metrics"],"type":"node"}],"type":"node"}," callback to track the accuracy of the model's predictions:"],"type":"node"}],"type":"node"},{"attributes":{"id":null,"execution_count":13},"tag":"codecell","children":[{"attributes":{},"tag":"codeinput","children":[{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Learner"},"tag":"reference","children":["Learner"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["lossfn"],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"vect","children":[{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ToGPU"},"tag":"reference","children":["ToGPU"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Metrics"},"tag":"reference","children":["Metrics"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.accuracy"},"tag":"reference","children":["accuracy"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["optimizer"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"coderesult","children":[{"attributes":{},"tag":"codeblock","children":[{"mimes":{"text/html":"Learner()"},"type":"leaf"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{"id":null},"tag":"md","children":[{"attributes":{},"tag":"h2","children":["Training"],"type":"node"}],"type":"node"},{"attributes":{"id":null},"tag":"md","children":[{"attributes":{},"tag":"p","children":["With a ",{"attributes":{},"tag":"code","children":["Learner"],"type":"node"}," in place, training is as simple as calling ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.fit!"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["fit!"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"code","children":["(learner, nepochs, dataiters)"],"type":"node"},"."],"type":"node"}],"type":"node"},{"attributes":{"id":null,"execution_count":14},"tag":"codecell","children":[{"attributes":{},"tag":"codeinput","children":[{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["FluxTraining"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.fit!"},"tag":"reference","children":["fit!"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["10"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["trainiter"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["testiter"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"codeoutput","children":[{"attributes":{},"tag":"codeblock","children":[{"mimes":{"text/html":"Epoch 1 TrainingPhase() ...\n┌───────────────┬───────┬─────────┬──────────┐\n│ Phase Epoch Loss Accuracy │\n├───────────────┼───────┼─────────┼──────────┤\n│ TrainingPhase │ 1.0 │ 1.92511 │ 0.30643 │\n└───────────────┴───────┴─────────┴──────────┘\nEpoch 1 ValidationPhase() ...\n┌─────────────────┬───────┬─────────┬──────────┐\n│ Phase Epoch Loss Accuracy │\n├─────────────────┼───────┼─────────┼──────────┤\n│ ValidationPhase │ 1.0 │ 1.56384 │ 0.429 │\n└─────────────────┴───────┴─────────┴──────────┘\nEpoch 2 TrainingPhase() ...\n┌───────────────┬───────┬─────────┬──────────┐\n│ Phase Epoch Loss Accuracy │\n├───────────────┼───────┼─────────┼──────────┤\n│ TrainingPhase │ 2.0 │ 1.40887 │ 0.53872 │\n└───────────────┴───────┴─────────┴──────────┘\nEpoch 2 ValidationPhase() ...\n┌─────────────────┬───────┬─────────┬──────────┐\n│ Phase Epoch Loss Accuracy │\n├─────────────────┼───────┼─────────┼──────────┤\n│ ValidationPhase │ 2.0 │ 1.25592 │ 0.57578 │\n└─────────────────┴───────┴─────────┴──────────┘\nEpoch 3 TrainingPhase() ...\n┌───────────────┬───────┬─────────┬──────────┐\n│ Phase Epoch Loss Accuracy │\n├───────────────┼───────┼─────────┼──────────┤\n│ TrainingPhase │ 3.0 │ 1.17799 │ 0.64023 │\n└───────────────┴───────┴─────────┴──────────┘\nEpoch 3 ValidationPhase() ...\n┌─────────────────┬───────┬────────┬──────────┐\n│ Phase Epoch Loss Accuracy │\n├─────────────────┼───────┼────────┼──────────┤\n│ ValidationPhase │ 3.0 │ 1.0728 │ 0.63809 │\n└─────────────────┴───────┴────────┴──────────┘\nEpoch 4 TrainingPhase() ...\n┌───────────────┬───────┬─────────┬──────────┐\n│ Phase Epoch Loss Accuracy │\n├───────────────┼───────┼─────────┼──────────┤\n│ TrainingPhase │ 4.0 │ 1.02755 │ 0.69311 │\n└───────────────┴───────┴─────────┴──────────┘\nEpoch 4 ValidationPhase() ...\n┌─────────────────┬───────┬─────────┬──────────┐\n│ Phase Epoch Loss Accuracy │\n├─────────────────┼───────┼─────────┼──────────┤\n│ ValidationPhase │ 4.0 │ 0.95165 │ 0.67871 │\n└─────────────────┴───────┴─────────┴──────────┘\nEpoch 5 TrainingPhase() ...\n┌───────────────┬───────┬─────────┬──────────┐\n│ Phase Epoch Loss Accuracy │\n├───────────────┼───────┼─────────┼──────────┤\n│ TrainingPhase │ 5.0 │ 0.91992 │ 0.72615 │\n└───────────────┴───────┴─────────┴──────────┘\nEpoch 5 ValidationPhase() ...\n┌─────────────────┬───────┬─────────┬──────────┐\n│ Phase Epoch Loss Accuracy │\n├─────────────────┼───────┼─────────┼──────────┤\n│ ValidationPhase │ 5.0 │ 0.86318 │ 0.70791 │\n└─────────────────┴───────┴─────────┴──────────┘\nEpoch 6 TrainingPhase() ...\n┌───────────────┬───────┬─────────┬──────────┐\n│ Phase Epoch Loss Accuracy │\n├───────────────┼───────┼─────────┼──────────┤\n│ TrainingPhase │ 6.0 │ 0.83481 │ 0.75419 │\n└───────────────┴───────┴─────────┴──────────┘\nEpoch 6 ValidationPhase() ...\n┌─────────────────┬───────┬─────────┬──────────┐\n│ Phase Epoch Loss Accuracy │\n├─────────────────┼───────┼─────────┼──────────┤\n│ ValidationPhase │ 6.0 │ 0.79026 │ 0.73604 │\n└─────────────────┴───────┴─────────┴──────────┘\nEpoch 7 TrainingPhase() ...\n┌───────────────┬───────┬────────┬──────────┐\n│ Phase Epoch Loss Accuracy │\n├───────────────┼───────┼────────┼──────────┤\n│ TrainingPhase │ 7.0 │ 0.7636 │ 0.77762 │\n└───────────────┴───────┴────────┴──────────┘\nEpoch 7 ValidationPhase() ...\n┌─────────────────┬───────┬─────────┬──────────┐\n│ Phase Epoch Loss Accuracy │\n├─────────────────┼───────┼─────────┼──────────┤\n│ ValidationPhase │ 7.0 │ 0.72974 │ 0.75869 │\n└─────────────────┴───────┴─────────┴──────────┘\nEpoch 8 TrainingPhase() ...\n┌───────────────┬───────┬─────────┬──────────┐\n│ Phase Epoch Loss Accuracy │\n├───────────────┼───────┼─────────┼──────────┤\n│ TrainingPhase │ 8.0 │ 0.70309 │ 0.79626 │\n└───────────────┴───────┴─────────┴──────────┘\nEpoch 8 ValidationPhase() ...\n┌─────────────────┬───────┬────────┬──────────┐\n│ Phase Epoch Loss Accuracy │\n├─────────────────┼───────┼────────┼──────────┤\n│ ValidationPhase │ 8.0 │ 0.6784 │ 0.77363 │\n└─────────────────┴───────┴────────┴──────────┘\nEpoch 9 TrainingPhase() ...\n┌───────────────┬───────┬─────────┬──────────┐\n│ Phase Epoch Loss Accuracy │\n├───────────────┼───────┼─────────┼──────────┤\n│ TrainingPhase │ 9.0 │ 0.65131 │ 0.81166 │\n└───────────────┴───────┴─────────┴──────────┘\nEpoch 9 ValidationPhase() ...\n┌─────────────────┬───────┬─────────┬──────────┐\n│ Phase Epoch Loss Accuracy │\n├─────────────────┼───────┼─────────┼──────────┤\n│ ValidationPhase │ 9.0 │ 0.63317 │ 0.79014 │\n└─────────────────┴───────┴─────────┴──────────┘\nEpoch 10 TrainingPhase() ...\n┌───────────────┬───────┬─────────┬──────────┐\n│ Phase Epoch Loss Accuracy │\n├───────────────┼───────┼─────────┼──────────┤\n│ TrainingPhase │ 10.0 │ 0.60669 │ 0.82449 │\n└───────────────┴───────┴─────────┴──────────┘\nEpoch 10 ValidationPhase() ...\n┌─────────────────┬───────┬─────────┬──────────┐\n│ Phase Epoch Loss Accuracy │\n├─────────────────┼───────┼─────────┼──────────┤\n│ ValidationPhase │ 10.0 │ 0.59359 │ 0.80527 │\n└─────────────────┴───────┴─────────┴──────────┘\n"},"type":"leaf"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{"id":null,"execution_count":null},"tag":"codecell","children":[{"attributes":{},"tag":"codeinput","children":[{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file diff --git a/data/FluxTraining@dev/doc/docs/tutorials/training.md.json b/data/FluxTraining@dev/doc/docs/tutorials/training.md.json index 9fce976f3..39d5f9a98 100644 --- a/data/FluxTraining@dev/doc/docs/tutorials/training.md.json +++ b/data/FluxTraining@dev/doc/docs/tutorials/training.md.json @@ -1 +1 @@ -{"attributes":{"backlinks":[{"tag":"document","title":"Models","docid":"FluxTraining@dev/doc/docs/background/model.md"},{"tag":"document","title":"Custom callbacks","docid":"FluxTraining@dev/doc/docs/callbacks/custom.md"},{"tag":"document","title":"Data iterators","docid":"FluxTraining@dev/doc/docs/background/dataiterator.md"},{"tag":"document","title":"Training loop API reference","docid":"FluxTraining@dev/doc/docs/reference/training.md"},{"tag":"document","title":"News","docid":"FluxTraining@dev/doc/CHANGELOG.md"}],"path":"/home/runner/.julia/packages/FluxTraining/xCOPx/docs/tutorials/training.md","title":"Training loop"},"tag":"document","children":[{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"h1","children":["Training loop"],"type":"node"},{"attributes":{},"tag":"p","children":["FluxTraining.jl comes with a training loop for standard supervised learning problems, but for different tasks like self-supervised learning, being able to write custom training logic is essential. The package's training loop API requires little boilerplate to convert a regular Flux.jl training loop while making it compatible with existing callbacks."],"type":"node"},{"attributes":{},"tag":"h2","children":["Supervised training, step-by-step"],"type":"node"},{"attributes":{},"tag":"p","children":["We'll explore the API step-by-step by converting a basic training loop and then discuss ways in which more complex training loops can be implemented using the same approach. The central piece of a training loop is the logic for a single training step, and in many cases, that will be all you need to implement. Below is the definition of a basic vanilla Flux.jl training step. It takes a batch of data, calculates the loss, gradients and finally updates the parameters of the model."],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.step!"},"tag":"reference","children":["step!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["batch"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["params"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["optimizer"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["lossfn"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"Identifier","children":["xs"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ys"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["batch"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["grads"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"do","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["gradient"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["params"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"do","children":["do"],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["ŷs"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["xs"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["loss"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["lossfn"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ŷs"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ys"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["loss"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["update!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["optimizer"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["params"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["grads"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"p","children":["To make a training step work with FluxTraining.jl and its callbacks, we need to"],"type":"node"},{"attributes":{},"tag":"ul","children":[{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["store data for a step so that callbacks can access it (e.g. ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.Metrics"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["Metrics"],"type":"node"}],"type":"node"}," uses ",{"attributes":{},"tag":"code","children":["ys"],"type":"node"}," and ",{"attributes":{},"tag":"code","children":["ŷs"],"type":"node"}," to evaluate metrics for each step); and"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["dispatch events so the callbacks are triggered"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"p","children":["We first need to create a ",{"attributes":{"href":"#","title":""},"tag":"a","children":[{"attributes":{},"tag":"code","children":["Phase"],"type":"node"}],"type":"node"}," and implement a method for ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.step!"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["FluxTraining.step!"],"type":"node"}],"type":"node"}," that dispatches on the phase type. ",{"attributes":{},"tag":"code","children":["Phase"],"type":"node"},"s are used to define different training behaviors using the same API and to define callback functionality that is only run during certain phases. For example, ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.Scheduler"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["Scheduler"],"type":"node"}],"type":"node"}," only runs during ",{"attributes":{"href":"#","title":""},"tag":"a","children":[{"attributes":{},"tag":"code","children":["AbstractTrainingPhase"],"type":"node"}],"type":"node"},"s but not during ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.ValidationPhase"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["ValidationPhase"],"type":"node"}],"type":"node"},". Let's implement such a phase and method, moving the arguments inside a ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.Learner"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["Learner"],"type":"node"}],"type":"node"}," in the process."],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":["struct MyTrainingPhase <: FluxTraining.AbstractTrainingPhase\n\nfunction FluxTraining.step!(learner, phase::MyTrainingPhase, batch)\n xs, ys = batch\n grads = gradient(learner.params) do\n ŷs = learner.model(xs)\n loss = learner.lossfn(ŷs, ys)\n return loss\n end\n update!(learner.optimizer, learner.params, grads)\nend"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"p","children":["Now we can already train a model using this implementation, for example using ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.epoch!"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["epoch!"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"code","children":["(learner, MyTrainingPhase(), dataiter)"],"type":"node"},". However, no callbacks would be called, since we haven't yet put in any logic that dispatches events or stores the step state. We can do both by using the helper function ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.runstep"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["runstep"],"type":"node"}],"type":"node"}," which takes care of runnning our step logic, dispatching a ",{"attributes":{"href":"#","title":""},"tag":"a","children":[{"attributes":{},"tag":"code","children":["StepBegin"],"type":"node"}],"type":"node"}," and ",{"attributes":{"href":"#","title":""},"tag":"a","children":[{"attributes":{},"tag":"code","children":["StepEnd"],"type":"node"}],"type":"node"}," event before and after and handling control flow exceptions like ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.CancelStepException"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["CancelStepException"],"type":"node"}],"type":"node"},". Additionally, ",{"attributes":{},"tag":"code","children":["runstep"],"type":"node"}," gives us a function ",{"attributes":{},"tag":"code","children":["handle"],"type":"node"}," which we can use to dispatch events inside the step, and ",{"attributes":{},"tag":"code","children":["state"],"type":"node"}," a container for storing step state. Let's use ",{"attributes":{},"tag":"code","children":["runstep"],"type":"node"}," and store the variables of interest inside ",{"attributes":{},"tag":"code","children":["state"],"type":"node"},":"],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.step!"},"tag":"reference","children":["step!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["MyTrainingPhase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["batch"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"Identifier","children":["xs"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ys"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["batch"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"do","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.runstep"},"tag":"reference","children":["runstep"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["xs"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Identifier","children":["xs"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["ys"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ys"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"do","children":["do"],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.handle"},"tag":"reference","children":["handle"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["grads"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"do","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["gradient"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["params"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"do","children":["do"],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["ŷs"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["xs"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["loss"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["lossfn"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["ŷs"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["ys"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["loss"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["update!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["optimizer"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["params"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["grads"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"p","children":["Now callbacks like ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.Metrics"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["Metrics"],"type":"node"}],"type":"node"}," can access variables like ",{"attributes":{},"tag":"code","children":["ys"],"type":"node"}," through ",{"attributes":{},"tag":"code","children":["learner.step"],"type":"node"}," (which is set to the last ",{"attributes":{},"tag":"code","children":["state"],"type":"node"},"). Finally, we can use ",{"attributes":{},"tag":"code","children":["handle"],"type":"node"}," to dispatch additional events:"],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":":","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["FluxTraining"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events"},"tag":"reference","children":["Events"],"type":"node"}],"type":"node"},{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["LossBegin"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["BackwardBegin"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["BackwardEnd"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.step!"},"tag":"reference","children":["step!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["MyTrainingPhase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["batch"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"Identifier","children":["xs"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ys"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["batch"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"do","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.runstep"},"tag":"reference","children":["runstep"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["xs"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Identifier","children":["xs"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["ys"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ys"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"do","children":["do"],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.handle"},"tag":"reference","children":["handle"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["grads"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"do","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["gradient"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["params"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"do","children":["do"],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["ŷs"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["xs"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.handle"},"tag":"reference","children":["handle"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["LossBegin"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["loss"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["lossfn"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["ŷs"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["ys"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.handle"},"tag":"reference","children":["handle"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["BackwardBegin"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["loss"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.handle"},"tag":"reference","children":["handle"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["BackwardEnd"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["update!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["optimizer"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["params"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["grads"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"p","children":["The result is the full implementation of FluxTraining.jl's own ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.TrainingPhase"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["TrainingPhase"],"type":"node"}],"type":"node"},"! Now we can use ",{"attributes":{},"tag":"code","children":["epoch!"],"type":"node"}," to train a ",{"attributes":{},"tag":"code","children":["Learner"],"type":"node"}," with full support for ",{"attributes":{"href":"../callbacks/reference.md","title":"","document_id":"FluxTraining@dev/doc/docs/callbacks/reference.md"},"tag":"reference","children":["all callbacks"],"type":"node"},":"],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"for","children":[{"attributes":{},"tag":"for","children":["for"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["i"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"in","children":["in"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["1"],"type":"node"},{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Integer","children":["10"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.epoch!"},"tag":"reference","children":["epoch!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["MyTrainingPhase"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["dataiter"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"h2","children":["Validation"],"type":"node"},{"attributes":{},"tag":"p","children":["The implementation of ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.ValidationPhase"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["ValidationPhase"],"type":"node"}],"type":"node"}," is even simpler; it runs the forward pass and stores variables so that callbacks like ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.Metrics"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["Metrics"],"type":"node"}],"type":"node"}," can access them."],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.ValidationPhase"},"tag":"reference","children":["ValidationPhase"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["AbstractValidationPhase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.step!"},"tag":"reference","children":["step!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.ValidationPhase"},"tag":"reference","children":["ValidationPhase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["batch"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"Identifier","children":["xs"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ys"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["batch"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"do","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.runstep"},"tag":"reference","children":["runstep"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["xs"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Identifier","children":["xs"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["ys"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ys"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"do","children":["do"],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["_"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["ŷs"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["xs"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["loss"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["lossfn"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["ŷs"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["ys"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"h2","children":["Epoch logic"],"type":"node"},{"attributes":{},"tag":"p","children":["We didn't need to implement a custom ",{"attributes":{},"tag":"code","children":["epoch!"],"type":"node"}," method for our phase since the default is fine here: it just iterates over every batch and calls ",{"attributes":{},"tag":"code","children":["step!"],"type":"node"},". In fact, let's have a look at how ",{"attributes":{},"tag":"code","children":["epoch!"],"type":"node"}," is implemented:"],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.epoch!"},"tag":"reference","children":["epoch!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Phase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["dataiter"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"do","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.runepoch"},"tag":"reference","children":["runepoch"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"do","children":["do"],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.handle"},"tag":"reference","children":["handle"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"for","children":[{"attributes":{},"tag":"for","children":["for"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["batch"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"in","children":["in"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["dataiter"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.step!"},"tag":"reference","children":["step!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["batch"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"p","children":["Here, ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.runepoch"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["runepoch"],"type":"node"}],"type":"node"},", similarly to ",{"attributes":{},"tag":"code","children":["runstep"],"type":"node"},", takes care of epoch start/stop events and control flow. If you want more control over your training loop, you can use it to write training loops that directly use ",{"attributes":{},"tag":"code","children":["step!"],"type":"node"},":"],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["MyTrainingPhase"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"do","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["withepoch"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"do","children":["do"],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.handle"},"tag":"reference","children":["handle"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"for","children":[{"attributes":{},"tag":"for","children":["for"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["batch"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"in","children":["in"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["dataiter"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.step!"},"tag":"reference","children":["step!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["batch"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["step"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["loss"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<","children":["<"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Float","children":["0.1"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["throw"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.CancelFittingException"},"tag":"reference","children":["CancelFittingException"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Low loss reached."],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"h2","children":["Tips"],"type":"node"},{"attributes":{},"tag":"p","children":["Here are some additional tips for making it easier to implement complicated training loops."],"type":"node"},{"attributes":{},"tag":"ul","children":[{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["You can pass (named) tuples of models to the ",{"attributes":{},"tag":"code","children":["Learner"],"type":"node"}," constructor. For example, for generative adversarial training, you can pass in ",{"attributes":{},"tag":"code","children":["(generator = ..., critic = ...)"],"type":"node"}," and then refer to them inside the ",{"attributes":{},"tag":"code","children":["step!"],"type":"node"}," implementation, e.g. using ",{"attributes":{},"tag":"code","children":["learner.model.generator"],"type":"node"},". The models' parameters will have the same structure, i.e. ",{"attributes":{},"tag":"code","children":["learner.params.generator"],"type":"node"}," corresponds to ",{"attributes":{},"tag":"code","children":["params(learner.model.generator)"],"type":"node"},"."],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["You can store any data you want in ",{"attributes":{},"tag":"code","children":["state"],"type":"node"},"."],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["When defining a custom phase, instead of subtyping ",{"attributes":{},"tag":"code","children":["Phase"],"type":"node"}," you can subtype ",{"attributes":{"href":"#","title":""},"tag":"a","children":[{"attributes":{},"tag":"code","children":["AbstractTrainingPhase"],"type":"node"}],"type":"node"}," or ",{"attributes":{"href":"#","title":""},"tag":"a","children":[{"attributes":{},"tag":"code","children":["AbstractValidationPhase"],"type":"node"}],"type":"node"}," so that some context-specific callbacks will work out of the box with your phase type. For example, ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.Scheduler"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["Scheduler"],"type":"node"}],"type":"node"}," sets hyperparameter values only during ",{"attributes":{},"tag":"code","children":["AbstractTrainingPhase"],"type":"node"},"."],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file +{"attributes":{"backlinks":[{"tag":"document","title":"Models","docid":"FluxTraining@dev/doc/docs/background/model.md"},{"tag":"document","title":"Custom callbacks","docid":"FluxTraining@dev/doc/docs/callbacks/custom.md"},{"tag":"document","title":"Data iterators","docid":"FluxTraining@dev/doc/docs/background/dataiterator.md"},{"tag":"document","title":"Training loop API reference","docid":"FluxTraining@dev/doc/docs/reference/training.md"},{"tag":"document","title":"News","docid":"FluxTraining@dev/doc/CHANGELOG.md"}],"path":"/home/runner/.julia/packages/FluxTraining/imTF4/docs/tutorials/training.md","title":"Training loop"},"tag":"document","children":[{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"h1","children":["Training loop"],"type":"node"},{"attributes":{},"tag":"p","children":["FluxTraining.jl comes with a training loop for standard supervised learning problems, but for different tasks like self-supervised learning, being able to write custom training logic is essential. The package's training loop API requires little boilerplate to convert a regular Flux.jl training loop while making it compatible with existing callbacks."],"type":"node"},{"attributes":{},"tag":"h2","children":["Supervised training, step-by-step"],"type":"node"},{"attributes":{},"tag":"p","children":["We'll explore the API step-by-step by converting a basic training loop and then discuss ways in which more complex training loops can be implemented using the same approach. The central piece of a training loop is the logic for a single training step, and in many cases, that will be all you need to implement. Below is the definition of a basic vanilla Flux.jl training step. It takes a batch of data, calculates the loss, gradients and finally updates the parameters of the model."],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.step!"},"tag":"reference","children":["step!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["batch"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["params"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["optimizer"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["lossfn"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"Identifier","children":["xs"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ys"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["batch"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["grads"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"do","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["gradient"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["params"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"do","children":["do"],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["ŷs"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["xs"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["loss"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["lossfn"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ŷs"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ys"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["loss"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["update!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["optimizer"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["params"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["grads"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"p","children":["To make a training step work with FluxTraining.jl and its callbacks, we need to"],"type":"node"},{"attributes":{},"tag":"ul","children":[{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["store data for a step so that callbacks can access it (e.g. ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.Metrics"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["Metrics"],"type":"node"}],"type":"node"}," uses ",{"attributes":{},"tag":"code","children":["ys"],"type":"node"}," and ",{"attributes":{},"tag":"code","children":["ŷs"],"type":"node"}," to evaluate metrics for each step); and"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["dispatch events so the callbacks are triggered"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"p","children":["We first need to create a ",{"attributes":{"href":"#","title":""},"tag":"a","children":[{"attributes":{},"tag":"code","children":["Phase"],"type":"node"}],"type":"node"}," and implement a method for ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.step!"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["FluxTraining.step!"],"type":"node"}],"type":"node"}," that dispatches on the phase type. ",{"attributes":{},"tag":"code","children":["Phase"],"type":"node"},"s are used to define different training behaviors using the same API and to define callback functionality that is only run during certain phases. For example, ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.Scheduler"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["Scheduler"],"type":"node"}],"type":"node"}," only runs during ",{"attributes":{"href":"#","title":""},"tag":"a","children":[{"attributes":{},"tag":"code","children":["AbstractTrainingPhase"],"type":"node"}],"type":"node"},"s but not during ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.ValidationPhase"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["ValidationPhase"],"type":"node"}],"type":"node"},". Let's implement such a phase and method, moving the arguments inside a ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.Learner"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["Learner"],"type":"node"}],"type":"node"}," in the process."],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":["struct MyTrainingPhase <: FluxTraining.AbstractTrainingPhase\n\nfunction FluxTraining.step!(learner, phase::MyTrainingPhase, batch)\n xs, ys = batch\n grads = gradient(learner.params) do\n ŷs = learner.model(xs)\n loss = learner.lossfn(ŷs, ys)\n return loss\n end\n update!(learner.optimizer, learner.params, grads)\nend"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"p","children":["Now we can already train a model using this implementation, for example using ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.epoch!"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["epoch!"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"code","children":["(learner, MyTrainingPhase(), dataiter)"],"type":"node"},". However, no callbacks would be called, since we haven't yet put in any logic that dispatches events or stores the step state. We can do both by using the helper function ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.runstep"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["runstep"],"type":"node"}],"type":"node"}," which takes care of runnning our step logic, dispatching a ",{"attributes":{"href":"#","title":""},"tag":"a","children":[{"attributes":{},"tag":"code","children":["StepBegin"],"type":"node"}],"type":"node"}," and ",{"attributes":{"href":"#","title":""},"tag":"a","children":[{"attributes":{},"tag":"code","children":["StepEnd"],"type":"node"}],"type":"node"}," event before and after and handling control flow exceptions like ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.CancelStepException"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["CancelStepException"],"type":"node"}],"type":"node"},". Additionally, ",{"attributes":{},"tag":"code","children":["runstep"],"type":"node"}," gives us a function ",{"attributes":{},"tag":"code","children":["handle"],"type":"node"}," which we can use to dispatch events inside the step, and ",{"attributes":{},"tag":"code","children":["state"],"type":"node"}," a container for storing step state. Let's use ",{"attributes":{},"tag":"code","children":["runstep"],"type":"node"}," and store the variables of interest inside ",{"attributes":{},"tag":"code","children":["state"],"type":"node"},":"],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.step!"},"tag":"reference","children":["step!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["MyTrainingPhase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["batch"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"Identifier","children":["xs"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ys"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["batch"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"do","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.runstep"},"tag":"reference","children":["runstep"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["xs"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Identifier","children":["xs"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["ys"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ys"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"do","children":["do"],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.handle"},"tag":"reference","children":["handle"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["grads"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"do","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["gradient"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["params"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"do","children":["do"],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["ŷs"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["xs"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["loss"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["lossfn"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["ŷs"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["ys"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["loss"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["update!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["optimizer"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["params"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["grads"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"p","children":["Now callbacks like ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.Metrics"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["Metrics"],"type":"node"}],"type":"node"}," can access variables like ",{"attributes":{},"tag":"code","children":["ys"],"type":"node"}," through ",{"attributes":{},"tag":"code","children":["learner.step"],"type":"node"}," (which is set to the last ",{"attributes":{},"tag":"code","children":["state"],"type":"node"},"). Finally, we can use ",{"attributes":{},"tag":"code","children":["handle"],"type":"node"}," to dispatch additional events:"],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":":","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["FluxTraining"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events"},"tag":"reference","children":["Events"],"type":"node"}],"type":"node"},{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["LossBegin"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["BackwardBegin"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["BackwardEnd"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.step!"},"tag":"reference","children":["step!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["MyTrainingPhase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["batch"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"Identifier","children":["xs"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ys"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["batch"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"do","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.runstep"},"tag":"reference","children":["runstep"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["xs"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Identifier","children":["xs"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["ys"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ys"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"do","children":["do"],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.handle"},"tag":"reference","children":["handle"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["grads"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"do","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["gradient"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["params"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"do","children":["do"],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["ŷs"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["xs"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.handle"},"tag":"reference","children":["handle"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["LossBegin"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["loss"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["lossfn"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["ŷs"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["ys"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.handle"},"tag":"reference","children":["handle"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["BackwardBegin"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["loss"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.handle"},"tag":"reference","children":["handle"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["BackwardEnd"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["update!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["optimizer"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["params"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["grads"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"p","children":["The result is the full implementation of FluxTraining.jl's own ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.TrainingPhase"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["TrainingPhase"],"type":"node"}],"type":"node"},"! Now we can use ",{"attributes":{},"tag":"code","children":["epoch!"],"type":"node"}," to train a ",{"attributes":{},"tag":"code","children":["Learner"],"type":"node"}," with full support for ",{"attributes":{"href":"../callbacks/reference.md","title":"","document_id":"FluxTraining@dev/doc/docs/callbacks/reference.md"},"tag":"reference","children":["all callbacks"],"type":"node"},":"],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"for","children":[{"attributes":{},"tag":"for","children":["for"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["i"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"in","children":["in"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["1"],"type":"node"},{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Integer","children":["10"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.epoch!"},"tag":"reference","children":["epoch!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["MyTrainingPhase"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["dataiter"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"h2","children":["Validation"],"type":"node"},{"attributes":{},"tag":"p","children":["The implementation of ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.ValidationPhase"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["ValidationPhase"],"type":"node"}],"type":"node"}," is even simpler; it runs the forward pass and stores variables so that callbacks like ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.Metrics"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["Metrics"],"type":"node"}],"type":"node"}," can access them."],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.ValidationPhase"},"tag":"reference","children":["ValidationPhase"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["AbstractValidationPhase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.step!"},"tag":"reference","children":["step!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.ValidationPhase"},"tag":"reference","children":["ValidationPhase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["batch"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"Identifier","children":["xs"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ys"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["batch"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"do","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.runstep"},"tag":"reference","children":["runstep"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["xs"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Identifier","children":["xs"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["ys"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ys"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"do","children":["do"],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["_"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["ŷs"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["xs"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["loss"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["lossfn"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["ŷs"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["ys"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"h2","children":["Epoch logic"],"type":"node"},{"attributes":{},"tag":"p","children":["We didn't need to implement a custom ",{"attributes":{},"tag":"code","children":["epoch!"],"type":"node"}," method for our phase since the default is fine here: it just iterates over every batch and calls ",{"attributes":{},"tag":"code","children":["step!"],"type":"node"},". In fact, let's have a look at how ",{"attributes":{},"tag":"code","children":["epoch!"],"type":"node"}," is implemented:"],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.epoch!"},"tag":"reference","children":["epoch!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Phase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["dataiter"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"do","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.runepoch"},"tag":"reference","children":["runepoch"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"do","children":["do"],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.handle"},"tag":"reference","children":["handle"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"for","children":[{"attributes":{},"tag":"for","children":["for"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["batch"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"in","children":["in"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["dataiter"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.step!"},"tag":"reference","children":["step!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["batch"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"p","children":["Here, ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.runepoch"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["runepoch"],"type":"node"}],"type":"node"},", similarly to ",{"attributes":{},"tag":"code","children":["runstep"],"type":"node"},", takes care of epoch start/stop events and control flow. If you want more control over your training loop, you can use it to write training loops that directly use ",{"attributes":{},"tag":"code","children":["step!"],"type":"node"},":"],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["MyTrainingPhase"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"do","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["withepoch"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"do","children":["do"],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.handle"},"tag":"reference","children":["handle"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"for","children":[{"attributes":{},"tag":"for","children":["for"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["batch"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"in","children":["in"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["dataiter"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.step!"},"tag":"reference","children":["step!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["batch"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["step"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["loss"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<","children":["<"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Float","children":["0.1"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["throw"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.CancelFittingException"},"tag":"reference","children":["CancelFittingException"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Low loss reached."],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"h2","children":["Tips"],"type":"node"},{"attributes":{},"tag":"p","children":["Here are some additional tips for making it easier to implement complicated training loops."],"type":"node"},{"attributes":{},"tag":"ul","children":[{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["You can pass (named) tuples of models to the ",{"attributes":{},"tag":"code","children":["Learner"],"type":"node"}," constructor. For example, for generative adversarial training, you can pass in ",{"attributes":{},"tag":"code","children":["(generator = ..., critic = ...)"],"type":"node"}," and then refer to them inside the ",{"attributes":{},"tag":"code","children":["step!"],"type":"node"}," implementation, e.g. using ",{"attributes":{},"tag":"code","children":["learner.model.generator"],"type":"node"},". The models' parameters will have the same structure, i.e. ",{"attributes":{},"tag":"code","children":["learner.params.generator"],"type":"node"}," corresponds to ",{"attributes":{},"tag":"code","children":["params(learner.model.generator)"],"type":"node"},"."],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["You can store any data you want in ",{"attributes":{},"tag":"code","children":["state"],"type":"node"},"."],"type":"node"}],"type":"node"},{"attributes":{},"tag":"li","children":[{"attributes":{},"tag":"p","children":["When defining a custom phase, instead of subtyping ",{"attributes":{},"tag":"code","children":["Phase"],"type":"node"}," you can subtype ",{"attributes":{"href":"#","title":""},"tag":"a","children":[{"attributes":{},"tag":"code","children":["AbstractTrainingPhase"],"type":"node"}],"type":"node"}," or ",{"attributes":{"href":"#","title":""},"tag":"a","children":[{"attributes":{},"tag":"code","children":["AbstractValidationPhase"],"type":"node"}],"type":"node"}," so that some context-specific callbacks will work out of the box with your phase type. For example, ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.Scheduler"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["Scheduler"],"type":"node"}],"type":"node"}," sets hyperparameter values only during ",{"attributes":{},"tag":"code","children":["AbstractTrainingPhase"],"type":"node"},"."],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file diff --git a/data/FluxTraining@dev/ref/FluxTraining.on.json b/data/FluxTraining@dev/ref/FluxTraining.on.json index 9a92f90d6..d8da71009 100644 --- a/data/FluxTraining@dev/ref/FluxTraining.on.json +++ b/data/FluxTraining@dev/ref/FluxTraining.on.json @@ -1 +1 @@ -{"attributes":{"kind":"function","backlinks":[{"tag":"document","title":"Tips & tricks","docid":"FluxTraining@dev/doc/docs/callbacks/tipstricks.md"},{"tag":"sourcefile","title":"FluxTraining/callbacks/earlystopping.jl","docid":"FluxTraining@dev/src/callbacks/earlystopping.jl"},{"tag":"sourcefile","title":"FluxTraining/callbacks/conditional.jl","docid":"FluxTraining@dev/src/callbacks/conditional.jl"},{"tag":"sourcefile","title":"FluxTraining/callbacks/logging/checkpointer.jl","docid":"FluxTraining@dev/src/callbacks/logging/checkpointer.jl"},{"tag":"sourcefile","title":"FluxTraining/callbacks/recorder.jl","docid":"FluxTraining@dev/src/callbacks/recorder.jl"},{"tag":"sourcefile","title":"FluxTraining/callbacks/custom.jl","docid":"FluxTraining@dev/src/callbacks/custom.jl"},{"tag":"sourcefile","title":"FluxTraining/callbacks/metrics.jl","docid":"FluxTraining@dev/src/callbacks/metrics.jl"},{"tag":"sourcefile","title":"FluxTraining/callbacks/callback.jl","docid":"FluxTraining@dev/src/callbacks/callback.jl"},{"tag":"sourcefile","title":"FluxTraining/callbacks/scheduler.jl","docid":"FluxTraining@dev/src/callbacks/scheduler.jl"},{"tag":"sourcefile","title":"FluxTraining/callbacks/logging/logger.jl","docid":"FluxTraining@dev/src/callbacks/logging/logger.jl"},{"tag":"document","title":"Custom callbacks","docid":"FluxTraining@dev/doc/docs/callbacks/custom.md"},{"tag":"sourcefile","title":"FluxTraining/callbacks/sanitycheck.jl","docid":"FluxTraining@dev/src/callbacks/sanitycheck.jl"},{"tag":"documentation","title":"Callback","docid":"FluxTraining@dev/ref/FluxTraining.Callback"},{"tag":"documentation","title":"Phase","docid":"FluxTraining@dev/ref/FluxTraining.Phases.Phase"},{"tag":"sourcefile","title":"FluxTraining/callbacks/trace.jl","docid":"FluxTraining@dev/src/callbacks/trace.jl"},{"tag":"sourcefile","title":"FluxTraining/callbacks/callbacks.jl","docid":"FluxTraining@dev/src/callbacks/callbacks.jl"}],"methods":[{"symbol_id":"FluxTraining.on","module_id":"FluxTraining","file":"callbacks/conditional.jl","line":66,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.on","module_id":"FluxTraining","file":"callbacks/custom.jl","line":35,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.on","module_id":"FluxTraining","file":"callbacks/callbacks.jl","line":15,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.on","module_id":"FluxTraining","file":"callbacks/callbacks.jl","line":102,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.on","module_id":"FluxTraining","file":"callbacks/metrics.jl","line":68,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.on","module_id":"FluxTraining","file":"callbacks/recorder.jl","line":31,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.on","module_id":"FluxTraining","file":"callbacks/sanitycheck.jl","line":75,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.on","module_id":"FluxTraining","file":"callbacks/logging/checkpointer.jl","line":29,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.on","module_id":"FluxTraining","file":"callbacks/callbacks.jl","line":46,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.on","module_id":"FluxTraining","file":"callbacks/earlystopping.jl","line":55,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.on","module_id":"FluxTraining","file":"callbacks/recorder.jl","line":43,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.on","module_id":"FluxTraining","file":"callbacks/logging/logger.jl","line":113,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.on","module_id":"FluxTraining","file":"callbacks/metrics.jl","line":83,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.on","module_id":"FluxTraining","file":"callbacks/logging/logger.jl","line":192,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.on","module_id":"FluxTraining","file":"callbacks/logging/logger.jl","line":247,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.on","module_id":"FluxTraining","file":"callbacks/callbacks.jl","line":29,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.on","module_id":"FluxTraining","file":"callbacks/recorder.jl","line":36,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.on","module_id":"FluxTraining","file":"callbacks/trace.jl","line":34,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.on","module_id":"FluxTraining","file":"callbacks/logging/logger.jl","line":59,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.on","module_id":"FluxTraining","file":"callbacks/logging/logger.jl","line":98,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.on","module_id":"FluxTraining","file":"callbacks/logging/logger.jl","line":153,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.on","module_id":"FluxTraining","file":"callbacks/metrics.jl","line":70,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.on","module_id":"FluxTraining","file":"callbacks/callbacks.jl","line":122,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.on","module_id":"FluxTraining","file":"callbacks/scheduler.jl","line":53,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.on","module_id":"FluxTraining","file":"callbacks/callbacks.jl","line":78,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.on","module_id":"FluxTraining","file":"callbacks/callback.jl","line":247,"signature":"(::Signature)"}],"package_id":"FluxTraining@dev","title":"on","symbol_id":"FluxTraining.on","exported":false,"module_id":"FluxTraining"},"tag":"documentation","children":[{"attributes":{"symbol":"FluxTraining.on","line":225,"module":"FluxTraining","file":"callbacks/callback.jl"},"tag":"docstring","children":[{"attributes":{},"tag":"md","children":[{"attributes":{"lang":""},"tag":"codeblock","children":["on(event::Event, phase::Phase, callback::AbstractCallback, learner)\n"],"type":"node"},{"attributes":{},"tag":"p","children":["Handle ",{"attributes":{},"tag":"code","children":["event"],"type":"node"}," with ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.Callback"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["Callback"],"type":"node"}],"type":"node"}," ",{"attributes":{},"tag":"code","children":["callback"],"type":"node"},". By default, this event handler does nothing for a callback."],"type":"node"},{"attributes":{},"tag":"p","children":["To see events which an ",{"attributes":{},"tag":"code","children":["AbstractCallback"],"type":"node"}," handles, use"],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":["methods(Training.on, (Any, Any, MyCallbackType, Any)"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"h2","children":["Extending"],"type":"node"},{"attributes":{},"tag":"p","children":["You can add event handlers to ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.Callback"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["Callback"],"type":"node"}],"type":"node"},"s by implementing a method for ",{"attributes":{},"tag":"code","children":["on"],"type":"node"},". See also ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.Callback"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["Callback"],"type":"node"}],"type":"node"}," and ",{"attributes":{"href":"documents/docs/callbacks/custom.md","title":"","document_id":"FluxTraining@dev/ref/documents/docs/callbacks/custom.md"},"tag":"reference","children":["custom callbacks"],"type":"node"},"."],"type":"node"},{"attributes":{},"tag":"p","children":["A method of ",{"attributes":{},"tag":"code","children":["on"],"type":"node"}," should ",{"attributes":{},"tag":"em","children":["always"],"type":"node"}," dispatch on the callback type, i.e. ",{"attributes":{},"tag":"code","children":["on(event, phase, cb::MyCallback, learner)"],"type":"node"},". It may also dispatch on specific ",{"attributes":{"href":"#","title":""},"tag":"a","children":[{"attributes":{},"tag":"code","children":["Event"],"type":"node"}],"type":"node"},"s and ",{"attributes":{"href":"#","title":""},"tag":"a","children":[{"attributes":{},"tag":"code","children":["Phase"],"type":"node"}],"type":"node"},". It should not dispatch on a specific type for ",{"attributes":{},"tag":"code","children":["learner"],"type":"node"},"."],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file +{"attributes":{"kind":"function","backlinks":[{"tag":"document","title":"Tips & tricks","docid":"FluxTraining@dev/doc/docs/callbacks/tipstricks.md"},{"tag":"sourcefile","title":"FluxTraining/callbacks/earlystopping.jl","docid":"FluxTraining@dev/src/callbacks/earlystopping.jl"},{"tag":"sourcefile","title":"FluxTraining/callbacks/conditional.jl","docid":"FluxTraining@dev/src/callbacks/conditional.jl"},{"tag":"sourcefile","title":"FluxTraining/callbacks/logging/checkpointer.jl","docid":"FluxTraining@dev/src/callbacks/logging/checkpointer.jl"},{"tag":"sourcefile","title":"FluxTraining/callbacks/recorder.jl","docid":"FluxTraining@dev/src/callbacks/recorder.jl"},{"tag":"sourcefile","title":"FluxTraining/callbacks/custom.jl","docid":"FluxTraining@dev/src/callbacks/custom.jl"},{"tag":"sourcefile","title":"FluxTraining/callbacks/metrics.jl","docid":"FluxTraining@dev/src/callbacks/metrics.jl"},{"tag":"sourcefile","title":"FluxTraining/callbacks/callback.jl","docid":"FluxTraining@dev/src/callbacks/callback.jl"},{"tag":"sourcefile","title":"FluxTraining/callbacks/scheduler.jl","docid":"FluxTraining@dev/src/callbacks/scheduler.jl"},{"tag":"sourcefile","title":"FluxTraining/callbacks/logging/logger.jl","docid":"FluxTraining@dev/src/callbacks/logging/logger.jl"},{"tag":"document","title":"Custom callbacks","docid":"FluxTraining@dev/doc/docs/callbacks/custom.md"},{"tag":"sourcefile","title":"FluxTraining/callbacks/sanitycheck.jl","docid":"FluxTraining@dev/src/callbacks/sanitycheck.jl"},{"tag":"documentation","title":"Callback","docid":"FluxTraining@dev/ref/FluxTraining.Callback"},{"tag":"documentation","title":"Phase","docid":"FluxTraining@dev/ref/FluxTraining.Phases.Phase"},{"tag":"sourcefile","title":"FluxTraining/callbacks/trace.jl","docid":"FluxTraining@dev/src/callbacks/trace.jl"},{"tag":"sourcefile","title":"FluxTraining/callbacks/callbacks.jl","docid":"FluxTraining@dev/src/callbacks/callbacks.jl"}],"methods":[{"symbol_id":"FluxTraining.on","module_id":"FluxTraining","file":"callbacks/conditional.jl","line":66,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.on","module_id":"FluxTraining","file":"callbacks/custom.jl","line":35,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.on","module_id":"FluxTraining","file":"callbacks/callbacks.jl","line":122,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.on","module_id":"FluxTraining","file":"callbacks/scheduler.jl","line":53,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.on","module_id":"FluxTraining","file":"callbacks/logging/checkpointer.jl","line":29,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.on","module_id":"FluxTraining","file":"callbacks/callbacks.jl","line":46,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.on","module_id":"FluxTraining","file":"callbacks/earlystopping.jl","line":55,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.on","module_id":"FluxTraining","file":"callbacks/recorder.jl","line":43,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.on","module_id":"FluxTraining","file":"callbacks/logging/logger.jl","line":113,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.on","module_id":"FluxTraining","file":"callbacks/metrics.jl","line":83,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.on","module_id":"FluxTraining","file":"callbacks/callbacks.jl","line":15,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.on","module_id":"FluxTraining","file":"callbacks/callbacks.jl","line":102,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.on","module_id":"FluxTraining","file":"callbacks/metrics.jl","line":68,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.on","module_id":"FluxTraining","file":"callbacks/recorder.jl","line":31,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.on","module_id":"FluxTraining","file":"callbacks/sanitycheck.jl","line":75,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.on","module_id":"FluxTraining","file":"callbacks/callbacks.jl","line":78,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.on","module_id":"FluxTraining","file":"callbacks/logging/logger.jl","line":192,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.on","module_id":"FluxTraining","file":"callbacks/logging/logger.jl","line":247,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.on","module_id":"FluxTraining","file":"callbacks/callbacks.jl","line":29,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.on","module_id":"FluxTraining","file":"callbacks/recorder.jl","line":36,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.on","module_id":"FluxTraining","file":"callbacks/trace.jl","line":34,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.on","module_id":"FluxTraining","file":"callbacks/logging/logger.jl","line":59,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.on","module_id":"FluxTraining","file":"callbacks/logging/logger.jl","line":98,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.on","module_id":"FluxTraining","file":"callbacks/logging/logger.jl","line":153,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.on","module_id":"FluxTraining","file":"callbacks/metrics.jl","line":70,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.on","module_id":"FluxTraining","file":"callbacks/callback.jl","line":247,"signature":"(::Signature)"}],"package_id":"FluxTraining@dev","title":"on","symbol_id":"FluxTraining.on","exported":false,"module_id":"FluxTraining"},"tag":"documentation","children":[{"attributes":{"symbol":"FluxTraining.on","line":225,"module":"FluxTraining","file":"callbacks/callback.jl"},"tag":"docstring","children":[{"attributes":{},"tag":"md","children":[{"attributes":{"lang":""},"tag":"codeblock","children":["on(event::Event, phase::Phase, callback::AbstractCallback, learner)\n"],"type":"node"},{"attributes":{},"tag":"p","children":["Handle ",{"attributes":{},"tag":"code","children":["event"],"type":"node"}," with ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.Callback"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["Callback"],"type":"node"}],"type":"node"}," ",{"attributes":{},"tag":"code","children":["callback"],"type":"node"},". By default, this event handler does nothing for a callback."],"type":"node"},{"attributes":{},"tag":"p","children":["To see events which an ",{"attributes":{},"tag":"code","children":["AbstractCallback"],"type":"node"}," handles, use"],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":["methods(Training.on, (Any, Any, MyCallbackType, Any)"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"h2","children":["Extending"],"type":"node"},{"attributes":{},"tag":"p","children":["You can add event handlers to ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.Callback"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["Callback"],"type":"node"}],"type":"node"},"s by implementing a method for ",{"attributes":{},"tag":"code","children":["on"],"type":"node"},". See also ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.Callback"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["Callback"],"type":"node"}],"type":"node"}," and ",{"attributes":{"href":"documents/docs/callbacks/custom.md","title":"","document_id":"FluxTraining@dev/ref/documents/docs/callbacks/custom.md"},"tag":"reference","children":["custom callbacks"],"type":"node"},"."],"type":"node"},{"attributes":{},"tag":"p","children":["A method of ",{"attributes":{},"tag":"code","children":["on"],"type":"node"}," should ",{"attributes":{},"tag":"em","children":["always"],"type":"node"}," dispatch on the callback type, i.e. ",{"attributes":{},"tag":"code","children":["on(event, phase, cb::MyCallback, learner)"],"type":"node"},". It may also dispatch on specific ",{"attributes":{"href":"#","title":""},"tag":"a","children":[{"attributes":{},"tag":"code","children":["Event"],"type":"node"}],"type":"node"},"s and ",{"attributes":{"href":"#","title":""},"tag":"a","children":[{"attributes":{},"tag":"code","children":["Phase"],"type":"node"}],"type":"node"},". It should not dispatch on a specific type for ",{"attributes":{},"tag":"code","children":["learner"],"type":"node"},"."],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file diff --git a/data/FluxTraining@dev/ref/FluxTraining.stateaccess.json b/data/FluxTraining@dev/ref/FluxTraining.stateaccess.json index a37673deb..410c0cc9a 100644 --- a/data/FluxTraining@dev/ref/FluxTraining.stateaccess.json +++ b/data/FluxTraining@dev/ref/FluxTraining.stateaccess.json @@ -1 +1 @@ -{"attributes":{"kind":"function","backlinks":[{"tag":"documentation","title":"CustomCallback","docid":"FluxTraining@dev/ref/FluxTraining.CustomCallback"},{"tag":"sourcefile","title":"FluxTraining/callbacks/graph.jl","docid":"FluxTraining@dev/src/callbacks/graph.jl"},{"tag":"sourcefile","title":"FluxTraining/callbacks/earlystopping.jl","docid":"FluxTraining@dev/src/callbacks/earlystopping.jl"},{"tag":"sourcefile","title":"FluxTraining/callbacks/hyperparameters.jl","docid":"FluxTraining@dev/src/callbacks/hyperparameters.jl"},{"tag":"sourcefile","title":"FluxTraining/callbacks/conditional.jl","docid":"FluxTraining@dev/src/callbacks/conditional.jl"},{"tag":"sourcefile","title":"FluxTraining/callbacks/logging/checkpointer.jl","docid":"FluxTraining@dev/src/callbacks/logging/checkpointer.jl"},{"tag":"document","title":"Hyperparameter scheduling","docid":"FluxTraining@dev/doc/docs/tutorials/hyperparameters.md"},{"tag":"document","title":"Callback reference","docid":"FluxTraining@dev/doc/docs/callbacks/reference.md"},{"tag":"documentation","title":"init!","docid":"FluxTraining@dev/ref/FluxTraining.init!"},{"tag":"sourcefile","title":"FluxTraining/callbacks/recorder.jl","docid":"FluxTraining@dev/src/callbacks/recorder.jl"},{"tag":"sourcefile","title":"FluxTraining/callbacks/custom.jl","docid":"FluxTraining@dev/src/callbacks/custom.jl"},{"tag":"sourcefile","title":"FluxTraining/callbacks/metrics.jl","docid":"FluxTraining@dev/src/callbacks/metrics.jl"},{"tag":"sourcefile","title":"FluxTraining/callbacks/callback.jl","docid":"FluxTraining@dev/src/callbacks/callback.jl"},{"tag":"sourcefile","title":"FluxTraining/callbacks/scheduler.jl","docid":"FluxTraining@dev/src/callbacks/scheduler.jl"},{"tag":"sourcefile","title":"FluxTraining/callbacks/logging/logger.jl","docid":"FluxTraining@dev/src/callbacks/logging/logger.jl"},{"tag":"document","title":"Custom callbacks","docid":"FluxTraining@dev/doc/docs/callbacks/custom.md"},{"tag":"sourcefile","title":"FluxTraining/callbacks/sanitycheck.jl","docid":"FluxTraining@dev/src/callbacks/sanitycheck.jl"},{"tag":"documentation","title":"Callback","docid":"FluxTraining@dev/ref/FluxTraining.Callback"},{"tag":"sourcefile","title":"FluxTraining/callbacks/trace.jl","docid":"FluxTraining@dev/src/callbacks/trace.jl"},{"tag":"sourcefile","title":"FluxTraining/callbacks/callbacks.jl","docid":"FluxTraining@dev/src/callbacks/callbacks.jl"},{"tag":"document","title":"How to use callbacks","docid":"FluxTraining@dev/doc/docs/callbacks/usage.md"}],"methods":[{"symbol_id":"FluxTraining.stateaccess","module_id":"FluxTraining","file":"callbacks/custom.jl","line":32,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.stateaccess","module_id":"FluxTraining","file":"callbacks/trace.jl","line":23,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.stateaccess","module_id":"FluxTraining","file":"callbacks/hyperparameters.jl","line":43,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.stateaccess","module_id":"FluxTraining","file":"callbacks/hyperparameters.jl","line":29,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.stateaccess","module_id":"FluxTraining","file":"callbacks/callbacks.jl","line":32,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.stateaccess","module_id":"FluxTraining","file":"callbacks/recorder.jl","line":18,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.stateaccess","module_id":"FluxTraining","file":"callbacks/callbacks.jl","line":106,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.stateaccess","module_id":"FluxTraining","file":"callbacks/logging/logger.jl","line":150,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.stateaccess","module_id":"FluxTraining","file":"callbacks/logging/checkpointer.jl","line":24,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.stateaccess","module_id":"FluxTraining","file":"callbacks/scheduler.jl","line":30,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.stateaccess","module_id":"FluxTraining","file":"callbacks/callbacks.jl","line":82,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.stateaccess","module_id":"FluxTraining","file":"callbacks/logging/logger.jl","line":94,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.stateaccess","module_id":"FluxTraining","file":"callbacks/logging/logger.jl","line":245,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.stateaccess","module_id":"FluxTraining","file":"callbacks/logging/logger.jl","line":189,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.stateaccess","module_id":"FluxTraining","file":"callbacks/sanitycheck.jl","line":66,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.stateaccess","module_id":"FluxTraining","file":"callbacks/metrics.jl","line":45,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.stateaccess","module_id":"FluxTraining","file":"callbacks/earlystopping.jl","line":77,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.stateaccess","module_id":"FluxTraining","file":"callbacks/callbacks.jl","line":63,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.stateaccess","module_id":"FluxTraining","file":"callbacks/conditional.jl","line":63,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.stateaccess","module_id":"FluxTraining","file":"callbacks/logging/logger.jl","line":57,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.stateaccess","module_id":"FluxTraining","file":"callbacks/callback.jl","line":77,"signature":"(::Signature)"}],"package_id":"FluxTraining@dev","title":"stateaccess","symbol_id":"FluxTraining.stateaccess","exported":false,"module_id":"FluxTraining"},"tag":"documentation","children":[{"attributes":{"symbol":"FluxTraining.stateaccess","line":52,"module":"FluxTraining","file":"callbacks/callback.jl"},"tag":"docstring","children":[{"attributes":{},"tag":"md","children":[{"attributes":{"lang":""},"tag":"codeblock","children":["stateaccess(callback)\n"],"type":"node"},{"attributes":{},"tag":"p","children":["Return a named tuple determining what learner state ",{"attributes":{},"tag":"code","children":["callback"],"type":"node"}," can access. The default is ",{"attributes":{},"tag":"code","children":["(;)"],"type":"node"},", the empty named tuple, meaning no state can be accessed. Implementations of ",{"attributes":{},"tag":"code","children":["stateaccess"],"type":"node"}," should always return the least permissions possible."],"type":"node"},{"attributes":{},"tag":"h2","children":["Extending"],"type":"node"},{"attributes":{},"tag":"p","children":["For example, the ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.ToGPU"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["ToGPU"],"type":"node"}],"type":"node"}," callback needs to write both the model and the batch data, so its ",{"attributes":{},"tag":"code","children":["stateaccess"],"type":"node"}," implementation is:"],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.stateaccess"},"tag":"reference","children":["stateaccess"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ToGPU"},"tag":"reference","children":["ToGPU"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Write"},"tag":"reference","children":["Write"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["params"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Write"},"tag":"reference","children":["Write"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["step"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["xs"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Write"},"tag":"reference","children":["Write"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["ys"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Write"},"tag":"reference","children":["Write"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"p","children":["When defining ",{"attributes":{},"tag":"code","children":["stateaccess"],"type":"node"},", be careful that you do return a ",{"attributes":{},"tag":"code","children":["NamedTuple"],"type":"node"},". ",{"attributes":{},"tag":"code","children":["(x = Read(),)"],"type":"node"}," is one but ",{"attributes":{},"tag":"code","children":["(x = Read())"],"type":"node"}," (without the comma) is parsed as an assignment with value ",{"attributes":{},"tag":"code","children":["Read()"],"type":"node"},"."],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{"symbol":"FluxTraining.stateaccess","line":22,"module":"FluxTraining","file":"callbacks/hyperparameters.jl"},"tag":"docstring","children":[{"attributes":{},"tag":"md","children":[{"attributes":{"lang":""},"tag":"codeblock","children":["stateaccess(::Type{HyperParameter})\n"],"type":"node"},{"attributes":{},"tag":"p","children":["Defines what ",{"attributes":{},"tag":"code","children":["Learner"],"type":"node"}," state is accessed when calling ",{"attributes":{},"tag":"code","children":["sethyperparameter!"],"type":"node"}," and ",{"attributes":{},"tag":"code","children":["gethyperparameter"],"type":"node"},". This is needed so that ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.Scheduler"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["Scheduler"],"type":"node"}],"type":"node"}," can access the state."],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file +{"attributes":{"kind":"function","backlinks":[{"tag":"documentation","title":"CustomCallback","docid":"FluxTraining@dev/ref/FluxTraining.CustomCallback"},{"tag":"sourcefile","title":"FluxTraining/callbacks/graph.jl","docid":"FluxTraining@dev/src/callbacks/graph.jl"},{"tag":"sourcefile","title":"FluxTraining/callbacks/earlystopping.jl","docid":"FluxTraining@dev/src/callbacks/earlystopping.jl"},{"tag":"sourcefile","title":"FluxTraining/callbacks/hyperparameters.jl","docid":"FluxTraining@dev/src/callbacks/hyperparameters.jl"},{"tag":"sourcefile","title":"FluxTraining/callbacks/conditional.jl","docid":"FluxTraining@dev/src/callbacks/conditional.jl"},{"tag":"sourcefile","title":"FluxTraining/callbacks/logging/checkpointer.jl","docid":"FluxTraining@dev/src/callbacks/logging/checkpointer.jl"},{"tag":"document","title":"Hyperparameter scheduling","docid":"FluxTraining@dev/doc/docs/tutorials/hyperparameters.md"},{"tag":"document","title":"Callback reference","docid":"FluxTraining@dev/doc/docs/callbacks/reference.md"},{"tag":"documentation","title":"init!","docid":"FluxTraining@dev/ref/FluxTraining.init!"},{"tag":"sourcefile","title":"FluxTraining/callbacks/recorder.jl","docid":"FluxTraining@dev/src/callbacks/recorder.jl"},{"tag":"sourcefile","title":"FluxTraining/callbacks/custom.jl","docid":"FluxTraining@dev/src/callbacks/custom.jl"},{"tag":"sourcefile","title":"FluxTraining/callbacks/metrics.jl","docid":"FluxTraining@dev/src/callbacks/metrics.jl"},{"tag":"sourcefile","title":"FluxTraining/callbacks/callback.jl","docid":"FluxTraining@dev/src/callbacks/callback.jl"},{"tag":"sourcefile","title":"FluxTraining/callbacks/scheduler.jl","docid":"FluxTraining@dev/src/callbacks/scheduler.jl"},{"tag":"sourcefile","title":"FluxTraining/callbacks/logging/logger.jl","docid":"FluxTraining@dev/src/callbacks/logging/logger.jl"},{"tag":"document","title":"Custom callbacks","docid":"FluxTraining@dev/doc/docs/callbacks/custom.md"},{"tag":"sourcefile","title":"FluxTraining/callbacks/sanitycheck.jl","docid":"FluxTraining@dev/src/callbacks/sanitycheck.jl"},{"tag":"documentation","title":"Callback","docid":"FluxTraining@dev/ref/FluxTraining.Callback"},{"tag":"sourcefile","title":"FluxTraining/callbacks/trace.jl","docid":"FluxTraining@dev/src/callbacks/trace.jl"},{"tag":"sourcefile","title":"FluxTraining/callbacks/callbacks.jl","docid":"FluxTraining@dev/src/callbacks/callbacks.jl"},{"tag":"document","title":"How to use callbacks","docid":"FluxTraining@dev/doc/docs/callbacks/usage.md"}],"methods":[{"symbol_id":"FluxTraining.stateaccess","module_id":"FluxTraining","file":"callbacks/trace.jl","line":23,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.stateaccess","module_id":"FluxTraining","file":"callbacks/custom.jl","line":32,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.stateaccess","module_id":"FluxTraining","file":"callbacks/hyperparameters.jl","line":43,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.stateaccess","module_id":"FluxTraining","file":"callbacks/hyperparameters.jl","line":29,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.stateaccess","module_id":"FluxTraining","file":"callbacks/callbacks.jl","line":82,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.stateaccess","module_id":"FluxTraining","file":"callbacks/conditional.jl","line":63,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.stateaccess","module_id":"FluxTraining","file":"callbacks/callbacks.jl","line":106,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.stateaccess","module_id":"FluxTraining","file":"callbacks/logging/logger.jl","line":94,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.stateaccess","module_id":"FluxTraining","file":"callbacks/scheduler.jl","line":30,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.stateaccess","module_id":"FluxTraining","file":"callbacks/metrics.jl","line":45,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.stateaccess","module_id":"FluxTraining","file":"callbacks/earlystopping.jl","line":77,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.stateaccess","module_id":"FluxTraining","file":"callbacks/logging/logger.jl","line":57,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.stateaccess","module_id":"FluxTraining","file":"callbacks/callbacks.jl","line":63,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.stateaccess","module_id":"FluxTraining","file":"callbacks/logging/checkpointer.jl","line":24,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.stateaccess","module_id":"FluxTraining","file":"callbacks/logging/logger.jl","line":245,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.stateaccess","module_id":"FluxTraining","file":"callbacks/logging/logger.jl","line":189,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.stateaccess","module_id":"FluxTraining","file":"callbacks/logging/logger.jl","line":150,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.stateaccess","module_id":"FluxTraining","file":"callbacks/sanitycheck.jl","line":66,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.stateaccess","module_id":"FluxTraining","file":"callbacks/callbacks.jl","line":32,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.stateaccess","module_id":"FluxTraining","file":"callbacks/recorder.jl","line":18,"signature":"(::Signature)"},{"symbol_id":"FluxTraining.stateaccess","module_id":"FluxTraining","file":"callbacks/callback.jl","line":77,"signature":"(::Signature)"}],"package_id":"FluxTraining@dev","title":"stateaccess","symbol_id":"FluxTraining.stateaccess","exported":false,"module_id":"FluxTraining"},"tag":"documentation","children":[{"attributes":{"symbol":"FluxTraining.stateaccess","line":52,"module":"FluxTraining","file":"callbacks/callback.jl"},"tag":"docstring","children":[{"attributes":{},"tag":"md","children":[{"attributes":{"lang":""},"tag":"codeblock","children":["stateaccess(callback)\n"],"type":"node"},{"attributes":{},"tag":"p","children":["Return a named tuple determining what learner state ",{"attributes":{},"tag":"code","children":["callback"],"type":"node"}," can access. The default is ",{"attributes":{},"tag":"code","children":["(;)"],"type":"node"},", the empty named tuple, meaning no state can be accessed. Implementations of ",{"attributes":{},"tag":"code","children":["stateaccess"],"type":"node"}," should always return the least permissions possible."],"type":"node"},{"attributes":{},"tag":"h2","children":["Extending"],"type":"node"},{"attributes":{},"tag":"p","children":["For example, the ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.ToGPU"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["ToGPU"],"type":"node"}],"type":"node"}," callback needs to write both the model and the batch data, so its ",{"attributes":{},"tag":"code","children":["stateaccess"],"type":"node"}," implementation is:"],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.stateaccess"},"tag":"reference","children":["stateaccess"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ToGPU"},"tag":"reference","children":["ToGPU"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Write"},"tag":"reference","children":["Write"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["params"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Write"},"tag":"reference","children":["Write"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["step"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["xs"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Write"},"tag":"reference","children":["Write"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["ys"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Write"},"tag":"reference","children":["Write"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"p","children":["When defining ",{"attributes":{},"tag":"code","children":["stateaccess"],"type":"node"},", be careful that you do return a ",{"attributes":{},"tag":"code","children":["NamedTuple"],"type":"node"},". ",{"attributes":{},"tag":"code","children":["(x = Read(),)"],"type":"node"}," is one but ",{"attributes":{},"tag":"code","children":["(x = Read())"],"type":"node"}," (without the comma) is parsed as an assignment with value ",{"attributes":{},"tag":"code","children":["Read()"],"type":"node"},"."],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{"symbol":"FluxTraining.stateaccess","line":22,"module":"FluxTraining","file":"callbacks/hyperparameters.jl"},"tag":"docstring","children":[{"attributes":{},"tag":"md","children":[{"attributes":{"lang":""},"tag":"codeblock","children":["stateaccess(::Type{HyperParameter})\n"],"type":"node"},{"attributes":{},"tag":"p","children":["Defines what ",{"attributes":{},"tag":"code","children":["Learner"],"type":"node"}," state is accessed when calling ",{"attributes":{},"tag":"code","children":["sethyperparameter!"],"type":"node"}," and ",{"attributes":{},"tag":"code","children":["gethyperparameter"],"type":"node"},". This is needed so that ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.Scheduler"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["Scheduler"],"type":"node"}],"type":"node"}," can access the state."],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file diff --git a/data/FluxTraining@dev/src/FluxTraining.jl.json b/data/FluxTraining@dev/src/FluxTraining.jl.json index d323ea069..cef40f252 100644 --- a/data/FluxTraining@dev/src/FluxTraining.jl.json +++ b/data/FluxTraining@dev/src/FluxTraining.jl.json @@ -1 +1 @@ -{"attributes":{"backlinks":[],"path":"/home/runner/.julia/packages/FluxTraining/xCOPx/src/FluxTraining.jl","package_id":"FluxTraining@dev","title":"FluxTraining/FluxTraining.jl","module_id":"FluxTraining"},"tag":"sourcefile","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"module","children":[{"attributes":{},"tag":"module","children":["module"],"type":"node"},{"attributes":{},"tag":"true","children":[""],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["FluxTraining"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Graphs"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":":","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["BSON"],"type":"node"}],"type":"node"},{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["load"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["save"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Flux"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":":","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Flux"],"type":"node"}],"type":"node"},{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Params"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["onecold"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":":","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Flux"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Optimise"],"type":"node"}],"type":"node"},{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["update!"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ImageCore"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["InlineTest"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Glob"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"module","children":[{"attributes":{},"tag":"module","children":["module"],"type":"node"},{"attributes":{},"tag":"true","children":[""],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ES"},"tag":"reference","children":["ES"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Reexport"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["reexport"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.EarlyStopping"},"tag":"reference","children":["EarlyStopping"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"import","children":[{"attributes":{},"tag":"import","children":["import"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["OnlineStats"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":":","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["OnlineStats"],"type":"node"}],"type":"node"},{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["EqualWeight"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Mean"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["OnlineStat"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"import","children":[{"attributes":{},"tag":"import","children":["import"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Optimisers"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Parameters"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":":","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ProgressMeter"],"type":"node"}],"type":"node"},{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Progress"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["next!"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":":","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Statistics"],"type":"node"}],"type":"node"},{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["mean"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["UUIDs"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Zygote"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ChainRulesCore"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ParameterSchedulers"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":":","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["TensorBoardLogger"],"type":"node"}],"type":"node"},{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["TBLogger"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["log_value"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["log_image"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["log_text"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["log_histogram"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["tb_overwrite"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":":","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Zygote"],"type":"node"}],"type":"node"},{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Grads"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["gradient"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ValueHistories"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":":","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["DataStructures"],"type":"node"}],"type":"node"},{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["DefaultDict"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["PriorityQueue"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["enqueue!"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["dequeue!"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["PrettyTables"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":":","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Setfield"],"type":"node"}],"type":"node"},{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["set"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"import","children":[{"attributes":{},"tag":"import","children":["import"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["PrecompileTools"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"Comment","children":["# functional"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["include"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["./functional/metrics.jl"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"Comment","children":["# callback system"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["include"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["./callbacks/protect.jl"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["include"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["./callbacks/phases.jl"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["include"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["./callbacks/events.jl"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["include"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["./callbacks/callback.jl"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["include"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["./callbacks/graph.jl"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["include"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["./callbacks/execution.jl"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"Comment","children":["# logging"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["include"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["./callbacks/logging/Loggables.jl"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["include"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["./callbacks/logging/logger.jl"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["include"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["./callbacks/logging/tensorboard.jl"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["include"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["./callbacks/logging/checkpointer.jl"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"Comment","children":["# callback implementations"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["include"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["./callbacks/conditional.jl"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["include"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["./callbacks/callbacks.jl"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["include"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["./callbacks/earlystopping.jl"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["include"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["./callbacks/custom.jl"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["include"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["./callbacks/metrics.jl"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["include"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["./callbacks/recorder.jl"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["include"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["./callbacks/trace.jl"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["include"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["./callbacks/sanitycheck.jl"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"Comment","children":["# hyperparameter scheduling"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["include"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["./callbacks/hyperparameters.jl"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["include"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["./callbacks/scheduler.jl"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"Comment","children":["# learner"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["include"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["./learner.jl"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["include"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["./callbackutils.jl"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["include"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["./training.jl"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["include"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["testutils.jl"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["PrecompileTools"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["compile_workload"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"begin","children":["begin"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.testlearner"},"tag":"reference","children":["testlearner"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.fit!"},"tag":"reference","children":["fit!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["1"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"export","children":[{"attributes":{},"tag":"export","children":["export"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.AbstractCallback"},"tag":"reference","children":["AbstractCallback"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loss"},"tag":"reference","children":["Loss"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ConditionalCallback"},"tag":"reference","children":["ConditionalCallback"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.CancelStepException"},"tag":"reference","children":["CancelStepException"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.CancelEpochException"},"tag":"reference","children":["CancelEpochException"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.CancelFittingException"},"tag":"reference","children":["CancelFittingException"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Checkpointer"},"tag":"reference","children":["Checkpointer"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.CustomCallback"},"tag":"reference","children":["CustomCallback"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.EarlyStopping"},"tag":"reference","children":["EarlyStopping"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ToDevice"},"tag":"reference","children":["ToDevice"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ToGPU"},"tag":"reference","children":["ToGPU"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.GarbageCollect"},"tag":"reference","children":["GarbageCollect"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Learner"},"tag":"reference","children":["Learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Metric"},"tag":"reference","children":["Metric"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Recorder"},"tag":"reference","children":["Recorder"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ProgressPrinter"},"tag":"reference","children":["ProgressPrinter"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Metrics"},"tag":"reference","children":["Metrics"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.MetricsPrinter"},"tag":"reference","children":["MetricsPrinter"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Traces"},"tag":"reference","children":["Traces"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.TrainingPhase"},"tag":"reference","children":["TrainingPhase"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.ValidationPhase"},"tag":"reference","children":["ValidationPhase"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Schedule"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Scheduler"},"tag":"reference","children":["Scheduler"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.LogMetrics"},"tag":"reference","children":["LogMetrics"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.SmoothLoss"},"tag":"reference","children":["SmoothLoss"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.LogTraces"},"tag":"reference","children":["LogTraces"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.LogHistograms"},"tag":"reference","children":["LogHistograms"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.LogHyperParams"},"tag":"reference","children":["LogHyperParams"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.LogVisualization"},"tag":"reference","children":["LogVisualization"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.TensorBoardBackend"},"tag":"reference","children":["TensorBoardBackend"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.StopOnNaNLoss"},"tag":"reference","children":["StopOnNaNLoss"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.LearningRate"},"tag":"reference","children":["LearningRate"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.throttle"},"tag":"reference","children":["throttle"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.SanityCheck"},"tag":"reference","children":["SanityCheck"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.accuracy"},"tag":"reference","children":["accuracy"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.fit!"},"tag":"reference","children":["fit!"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.epoch!"},"tag":"reference","children":["epoch!"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.step!"},"tag":"reference","children":["step!"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.onecycle"},"tag":"reference","children":["onecycle"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.loadmodel"},"tag":"reference","children":["loadmodel"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.savemodel"},"tag":"reference","children":["savemodel"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"p","children":["module"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file +{"attributes":{"backlinks":[],"path":"/home/runner/.julia/packages/FluxTraining/imTF4/src/FluxTraining.jl","package_id":"FluxTraining@dev","title":"FluxTraining/FluxTraining.jl","module_id":"FluxTraining"},"tag":"sourcefile","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"module","children":[{"attributes":{},"tag":"module","children":["module"],"type":"node"},{"attributes":{},"tag":"true","children":[""],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["FluxTraining"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Graphs"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":":","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["BSON"],"type":"node"}],"type":"node"},{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["load"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["save"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Flux"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":":","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Flux"],"type":"node"}],"type":"node"},{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Params"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["onecold"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":":","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Flux"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Optimise"],"type":"node"}],"type":"node"},{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["update!"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ImageCore"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["InlineTest"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Glob"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"module","children":[{"attributes":{},"tag":"module","children":["module"],"type":"node"},{"attributes":{},"tag":"true","children":[""],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ES"},"tag":"reference","children":["ES"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Reexport"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["reexport"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.EarlyStopping"},"tag":"reference","children":["EarlyStopping"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"import","children":[{"attributes":{},"tag":"import","children":["import"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["OnlineStats"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":":","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["OnlineStats"],"type":"node"}],"type":"node"},{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["EqualWeight"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Mean"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["OnlineStat"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"import","children":[{"attributes":{},"tag":"import","children":["import"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Optimisers"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Parameters"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":":","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ProgressMeter"],"type":"node"}],"type":"node"},{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Progress"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["next!"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":":","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Statistics"],"type":"node"}],"type":"node"},{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["mean"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["UUIDs"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Zygote"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ChainRulesCore"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ParameterSchedulers"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":":","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["TensorBoardLogger"],"type":"node"}],"type":"node"},{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["TBLogger"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["log_value"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["log_image"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["log_text"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["log_histogram"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["tb_overwrite"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":":","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Zygote"],"type":"node"}],"type":"node"},{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Grads"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["gradient"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ValueHistories"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":":","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["DataStructures"],"type":"node"}],"type":"node"},{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["DefaultDict"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["PriorityQueue"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["enqueue!"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["dequeue!"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["PrettyTables"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":":","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Setfield"],"type":"node"}],"type":"node"},{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["set"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"import","children":[{"attributes":{},"tag":"import","children":["import"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["PrecompileTools"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"Comment","children":["# functional"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["include"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["./functional/metrics.jl"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"Comment","children":["# callback system"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["include"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["./callbacks/protect.jl"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["include"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["./callbacks/phases.jl"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["include"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["./callbacks/events.jl"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["include"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["./callbacks/callback.jl"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["include"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["./callbacks/graph.jl"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["include"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["./callbacks/execution.jl"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"Comment","children":["# logging"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["include"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["./callbacks/logging/Loggables.jl"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["include"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["./callbacks/logging/logger.jl"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["include"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["./callbacks/logging/tensorboard.jl"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["include"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["./callbacks/logging/checkpointer.jl"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"Comment","children":["# callback implementations"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["include"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["./callbacks/conditional.jl"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["include"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["./callbacks/callbacks.jl"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["include"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["./callbacks/earlystopping.jl"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["include"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["./callbacks/custom.jl"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["include"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["./callbacks/metrics.jl"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["include"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["./callbacks/recorder.jl"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["include"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["./callbacks/trace.jl"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["include"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["./callbacks/sanitycheck.jl"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"Comment","children":["# hyperparameter scheduling"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["include"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["./callbacks/hyperparameters.jl"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["include"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["./callbacks/scheduler.jl"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"Comment","children":["# learner"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["include"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["./learner.jl"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["include"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["./callbackutils.jl"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["include"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["./training.jl"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["include"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["testutils.jl"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["PrecompileTools"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["compile_workload"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"begin","children":["begin"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.testlearner"},"tag":"reference","children":["testlearner"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.fit!"},"tag":"reference","children":["fit!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["1"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"export","children":[{"attributes":{},"tag":"export","children":["export"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.AbstractCallback"},"tag":"reference","children":["AbstractCallback"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loss"},"tag":"reference","children":["Loss"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ConditionalCallback"},"tag":"reference","children":["ConditionalCallback"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.CancelStepException"},"tag":"reference","children":["CancelStepException"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.CancelEpochException"},"tag":"reference","children":["CancelEpochException"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.CancelFittingException"},"tag":"reference","children":["CancelFittingException"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Checkpointer"},"tag":"reference","children":["Checkpointer"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.CustomCallback"},"tag":"reference","children":["CustomCallback"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.EarlyStopping"},"tag":"reference","children":["EarlyStopping"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ToDevice"},"tag":"reference","children":["ToDevice"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ToGPU"},"tag":"reference","children":["ToGPU"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.GarbageCollect"},"tag":"reference","children":["GarbageCollect"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Learner"},"tag":"reference","children":["Learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Metric"},"tag":"reference","children":["Metric"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Recorder"},"tag":"reference","children":["Recorder"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ProgressPrinter"},"tag":"reference","children":["ProgressPrinter"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Metrics"},"tag":"reference","children":["Metrics"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.MetricsPrinter"},"tag":"reference","children":["MetricsPrinter"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Traces"},"tag":"reference","children":["Traces"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.TrainingPhase"},"tag":"reference","children":["TrainingPhase"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.ValidationPhase"},"tag":"reference","children":["ValidationPhase"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Schedule"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Scheduler"},"tag":"reference","children":["Scheduler"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.LogMetrics"},"tag":"reference","children":["LogMetrics"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.SmoothLoss"},"tag":"reference","children":["SmoothLoss"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.LogTraces"},"tag":"reference","children":["LogTraces"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.LogHistograms"},"tag":"reference","children":["LogHistograms"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.LogHyperParams"},"tag":"reference","children":["LogHyperParams"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.LogVisualization"},"tag":"reference","children":["LogVisualization"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.TensorBoardBackend"},"tag":"reference","children":["TensorBoardBackend"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.StopOnNaNLoss"},"tag":"reference","children":["StopOnNaNLoss"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.LearningRate"},"tag":"reference","children":["LearningRate"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.throttle"},"tag":"reference","children":["throttle"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.SanityCheck"},"tag":"reference","children":["SanityCheck"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.accuracy"},"tag":"reference","children":["accuracy"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.fit!"},"tag":"reference","children":["fit!"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.epoch!"},"tag":"reference","children":["epoch!"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.step!"},"tag":"reference","children":["step!"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.onecycle"},"tag":"reference","children":["onecycle"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.loadmodel"},"tag":"reference","children":["loadmodel"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.savemodel"},"tag":"reference","children":["savemodel"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"p","children":["module"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file diff --git a/data/FluxTraining@dev/src/callbacks/callback.jl.json b/data/FluxTraining@dev/src/callbacks/callback.jl.json index 4a9c7aa7b..b5ed54d00 100644 --- a/data/FluxTraining@dev/src/callbacks/callback.jl.json +++ b/data/FluxTraining@dev/src/callbacks/callback.jl.json @@ -1 +1 @@ -{"attributes":{"backlinks":[],"path":"/home/runner/.julia/packages/FluxTraining/xCOPx/src/callbacks/callback.jl","package_id":"FluxTraining@dev","title":"FluxTraining/callbacks/callback.jl","module_id":"FluxTraining"},"tag":"sourcefile","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" abstract type AbstractCallback\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Supertype of [`SafeCallback`](#)/`Callback`. When implementing callbacks,\n"],"type":"node"},{"attributes":{},"tag":"String","children":["you should subtype [`SafeCallback`](#) instead.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"abstract","children":[{"attributes":{},"tag":"abstract","children":["abstract"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"type","children":["type"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.AbstractCallback"},"tag":"reference","children":["AbstractCallback"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"abstract","children":[{"attributes":{},"tag":"abstract","children":["abstract"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"type","children":["type"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.SafeCallback"},"tag":"reference","children":["SafeCallback"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.AbstractCallback"},"tag":"reference","children":["AbstractCallback"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" abstract type Callback\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Supertype of all callbacks. Callbacks add custom functionality to\n"],"type":"node"},{"attributes":{},"tag":"String","children":["the training loop by hooking into different [`Events.Event`](#)s\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Any `Callback` can be used by passing it to [`Learner`](#). See\n"],"type":"node"},{"attributes":{},"tag":"String","children":["`subtypes(FluxTraining.Callback)` for implementations.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["## Extending\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["See [Custom callbacks](/docs/docs/callbacks/custom.md) for a less\n"],"type":"node"},{"attributes":{},"tag":"String","children":["succinct tutorial format.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["1. Create a `struct MyCallback` that subtypes `FluxTraining.Callback`.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["2. Add event handlers by implementing methods for\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" [`on`](#)`(event, phase, callback, learner)`. Methods should always\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" dispatch on your callback, and may dispatch on specific [`Phases.Phase`](#)s\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" and [`Events.Event`](#)s.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" For example, to implement an event handler that runs at the end of every\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" step during training: `on(::StepEnd, ::AbstractTrainingPhase, ::MyCallback, learner)`.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["3. Define what state the callback accesses and/or modifies by implementing\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" [`stateaccess`](#)`(::MyCallback)`. While `learner` is always passed as an\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" argument to `on` event handlers, by default a callback can not read or write\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" to its fields. See [`stateaccess`](#) for more detail.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" If a callback needs to write some state that other callbacks should be able\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" to access, it can store it in `learner.cbstate` if you add a permission in\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" `stateaccess`.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["4. If the callback needs some one-time initialization, you can implement [`init!`](#)\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" which will be run at least once before any step is run.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"const","children":[{"attributes":{},"tag":"const","children":["const"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Callback"},"tag":"reference","children":["Callback"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.SafeCallback"},"tag":"reference","children":["SafeCallback"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"abstract","children":[{"attributes":{},"tag":"abstract","children":["abstract"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"type","children":["type"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.UnsafeCallback"},"tag":"reference","children":["UnsafeCallback"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.AbstractCallback"},"tag":"reference","children":["AbstractCallback"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"p","children":["TODO: implement proper merging of permissions"],"type":"node"}],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" stateaccess(callback)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Return a named tuple determining what learner state `callback`\n"],"type":"node"},{"attributes":{},"tag":"String","children":["can access. The default is `(;)`, the empty named tuple, meaning\n"],"type":"node"},{"attributes":{},"tag":"String","children":["no state can be accessed. Implementations of `stateaccess` should\n"],"type":"node"},{"attributes":{},"tag":"String","children":["always return the least permissions possible.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["## Extending\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["For example, the [`ToGPU`](#) callback needs to write both the model and\n"],"type":"node"},{"attributes":{},"tag":"String","children":["the batch data, so its `stateaccess` implementation is:\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["```julia\n"],"type":"node"},{"attributes":{},"tag":"String","children":["stateaccess(::ToGPU) = (\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" model = Write(),\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" params = Write(),\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" step = (xs = Write(), ys = Write()),\n"],"type":"node"},{"attributes":{},"tag":"String","children":[")\n"],"type":"node"},{"attributes":{},"tag":"String","children":["```\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["When defining `stateaccess`, be careful that you do return a `NamedTuple`.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["`(x = Read(),)` is one but `(x = Read())` (without the comma) is parsed as\n"],"type":"node"},{"attributes":{},"tag":"String","children":["an assignment with value `Read()`.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.stateaccess"},"tag":"reference","children":["stateaccess"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Callback"},"tag":"reference","children":["Callback"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.runafter"},"tag":"reference","children":["runafter"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.AbstractCallback"},"tag":"reference","children":["AbstractCallback"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" abstract type ConflictResolution\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["A conflict resolution strategy for resolving write/write conflicts\n"],"type":"node"},{"attributes":{},"tag":"String","children":["of two callbacks.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["See [`resolveconflict`](#).\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"abstract","children":[{"attributes":{},"tag":"abstract","children":["abstract"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"type","children":["type"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ConflictResolution"},"tag":"reference","children":["ConflictResolution"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" abstract type NotDefined <: ConflictResolution\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["The default implementation of [`resolveconflict`](#). If a conflict\n"],"type":"node"},{"attributes":{},"tag":"String","children":["is detected, this ensures an error message is printed.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.NotDefined"},"tag":"reference","children":["NotDefined"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ConflictResolution"},"tag":"reference","children":["ConflictResolution"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" abstract type Unresolvable <: ConflictResolution\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Return from [`resolveconflict`](#) to indicate that two callbacks\n"],"type":"node"},{"attributes":{},"tag":"String","children":["are incompatible and cannot be used together.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Unresolvable"},"tag":"reference","children":["Unresolvable"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ConflictResolution"},"tag":"reference","children":["ConflictResolution"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" abstract type RunFirst <: ConflictResolution\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Return `RunFirst(cb1/cb2)` from [`resolveconflict`](#)`(cb1, cb2)` to indicate\n"],"type":"node"},{"attributes":{},"tag":"String","children":["that one of the callbacks should always run before the other.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.RunFirst"},"tag":"reference","children":["RunFirst"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ConflictResolution"},"tag":"reference","children":["ConflictResolution"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" abstract type NoConflict <: ConflictResolution\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Return from [`resolveconflict`](#) to indicate that, while the callbacks\n"],"type":"node"},{"attributes":{},"tag":"String","children":["modify the same state, they can be used together without any problems.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.NoConflict"},"tag":"reference","children":["NoConflict"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ConflictResolution"},"tag":"reference","children":["ConflictResolution"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["_resolveconflict"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb1"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb2"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["r"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.resolveconflict"},"tag":"reference","children":["resolveconflict"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb1"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb2"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["r"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"===","children":["==="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.NotDefined"},"tag":"reference","children":["NotDefined"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.resolveconflict"},"tag":"reference","children":["resolveconflict"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb2"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb1"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"else","children":["else"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["r"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" resolveconflict(cb1, cb2)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Define a conflict resolution strategy for resolving a write/write conflict\n"],"type":"node"},{"attributes":{},"tag":"String","children":["between two callbacks.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["The default is [`NotDefined()`], which will result in an error and a message\n"],"type":"node"},{"attributes":{},"tag":"String","children":["to implement this method.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["To implement, dispatch on the callback types that you which to resolve (in any\n"],"type":"node"},{"attributes":{},"tag":"String","children":["order) and return one of the following:\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- [`Unresolvable`](#)`()` if the callbacks must not be used together\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- [`RunFirst`](#)`(cb)` if one of the callbacks needs to run first; or\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- [`NoConflict`](#)`()` if the callbacks may run together in any order\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.resolveconflict"},"tag":"reference","children":["resolveconflict"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.AbstractCallback"},"tag":"reference","children":["AbstractCallback"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.AbstractCallback"},"tag":"reference","children":["AbstractCallback"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.NotDefined"},"tag":"reference","children":["NotDefined"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" abstract type FitException\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Abstract types for exceptions that can be thrown during fitting,\n"],"type":"node"},{"attributes":{},"tag":"String","children":["to change its control flow.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["See [`CancelStepException`](#), [`CancelEpochException`](#), [`CancelFittingException`](#).\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"abstract","children":[{"attributes":{},"tag":"abstract","children":["abstract"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"type","children":["type"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.FitException"},"tag":"reference","children":["FitException"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Exception"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" CancelStepException(message)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Throw during fitting to cancel the currently running step.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["This prematurely ends the current step without throwing an error.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Must be thrown inside the context of [`runstep`](#).\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["## Examples\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["```julia\n"],"type":"node"},{"attributes":{},"tag":"String","children":["runepoch(learner, phase) do _\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" for (xs, ys) in batches\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" runstep(learner, phase, (; xs, ys)) do _, state\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" # training logic...\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" if isnan(state.loss).\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" throw(CancelStepException(\"Skipping NaN loss\"))\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" end\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" end\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" end\n"],"type":"node"},{"attributes":{},"tag":"String","children":["end\n"],"type":"node"},{"attributes":{},"tag":"String","children":["```\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.CancelStepException"},"tag":"reference","children":["CancelStepException"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.FitException"},"tag":"reference","children":["FitException"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["msg"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["String"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" CancelEpochException(message)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Throw during fitting to cancel the currently running epoch.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["This prematurely ends the current epoch without throwing an error.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Must be thrown inside the context of [`runepoch`](#).\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["## Examples\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["```julia\n"],"type":"node"},{"attributes":{},"tag":"String","children":["runepoch(learner, phase) do _\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" for batch in batches\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" step!(learner, phase, batch)\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" if learner.step.loss < 1.\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" throw(CancelEpochException(\"Reached target loss\"))\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" end\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" end\n"],"type":"node"},{"attributes":{},"tag":"String","children":["end\n"],"type":"node"},{"attributes":{},"tag":"String","children":["```\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.CancelEpochException"},"tag":"reference","children":["CancelEpochException"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.FitException"},"tag":"reference","children":["FitException"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["msg"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["String"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" CancelFittingException(msg)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Throw during fitting to cancel it.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.CancelFittingException"},"tag":"reference","children":["CancelFittingException"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.FitException"},"tag":"reference","children":["FitException"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["msg"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["String"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"p","children":["Callback hook"],"type":"node"}],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" on(event::Event, phase::Phase, callback::AbstractCallback, learner)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Handle `event` with [`Callback`](#) `callback`.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["By default, this event handler does nothing for a callback.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["To see events which an `AbstractCallback` handles, use\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["```julia\n"],"type":"node"},{"attributes":{},"tag":"String","children":["methods(Training.on, (Any, Any, MyCallbackType, Any)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["```\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["## Extending\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["You can add event handlers to [`Callback`](#)s by implementing a method for `on`.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["See also [`Callback`](#) and [custom callbacks](documents/docs/callbacks/custom.md).\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["A method of `on` should *always* dispatch on the callback type, i.e.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["`on(event, phase, cb::MyCallback, learner)`. It may also dispatch on specific\n"],"type":"node"},{"attributes":{},"tag":"String","children":["[`Event`](#)s and [`Phase`](#). It should not dispatch on a specific type for\n"],"type":"node"},{"attributes":{},"tag":"String","children":["`learner`.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.on"},"tag":"reference","children":["on"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.Event"},"tag":"reference","children":["Event"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Callback"},"tag":"reference","children":["Callback"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"nothing","children":[""],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["_on"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["e"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["p"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.on"},"tag":"reference","children":["on"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["e"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["p"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["_on"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["e"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["p"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.SafeCallback"},"tag":"reference","children":["SafeCallback"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["perms"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"do","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["ChainRulesCore"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["ignore_derivatives"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"do","children":["do"],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.stateaccess"},"tag":"reference","children":["stateaccess"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.on"},"tag":"reference","children":["on"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["e"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["p"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.protect"},"tag":"reference","children":["protect"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["perms"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" init!(callback, learner)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Initialize a callback. Default is to do nothing.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["## Extending\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["To extend for a callback, implement `init!(cb::MyCallback, learner)`.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["`init!` can set up internal state of a callback that depends on `learner`\n"],"type":"node"},{"attributes":{},"tag":"String","children":["and can also initialize shared callback state in `learner.cbstate`.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Just like `on` event handlers, the state access permissions must be correctly\n"],"type":"node"},{"attributes":{},"tag":"String","children":["defined using [`stateaccess`](#) to do so.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["`init!` must also be idempotent, i.e. running it twice on the same `Learner`\n"],"type":"node"},{"attributes":{},"tag":"String","children":["should have the same effect as runnning it once.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.init!"},"tag":"reference","children":["init!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Callback"},"tag":"reference","children":["Callback"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"nothing","children":[""],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file +{"attributes":{"backlinks":[],"path":"/home/runner/.julia/packages/FluxTraining/imTF4/src/callbacks/callback.jl","package_id":"FluxTraining@dev","title":"FluxTraining/callbacks/callback.jl","module_id":"FluxTraining"},"tag":"sourcefile","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" abstract type AbstractCallback\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Supertype of [`SafeCallback`](#)/`Callback`. When implementing callbacks,\n"],"type":"node"},{"attributes":{},"tag":"String","children":["you should subtype [`SafeCallback`](#) instead.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"abstract","children":[{"attributes":{},"tag":"abstract","children":["abstract"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"type","children":["type"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.AbstractCallback"},"tag":"reference","children":["AbstractCallback"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"abstract","children":[{"attributes":{},"tag":"abstract","children":["abstract"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"type","children":["type"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.SafeCallback"},"tag":"reference","children":["SafeCallback"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.AbstractCallback"},"tag":"reference","children":["AbstractCallback"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" abstract type Callback\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Supertype of all callbacks. Callbacks add custom functionality to\n"],"type":"node"},{"attributes":{},"tag":"String","children":["the training loop by hooking into different [`Events.Event`](#)s\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Any `Callback` can be used by passing it to [`Learner`](#). See\n"],"type":"node"},{"attributes":{},"tag":"String","children":["`subtypes(FluxTraining.Callback)` for implementations.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["## Extending\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["See [Custom callbacks](/docs/docs/callbacks/custom.md) for a less\n"],"type":"node"},{"attributes":{},"tag":"String","children":["succinct tutorial format.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["1. Create a `struct MyCallback` that subtypes `FluxTraining.Callback`.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["2. Add event handlers by implementing methods for\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" [`on`](#)`(event, phase, callback, learner)`. Methods should always\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" dispatch on your callback, and may dispatch on specific [`Phases.Phase`](#)s\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" and [`Events.Event`](#)s.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" For example, to implement an event handler that runs at the end of every\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" step during training: `on(::StepEnd, ::AbstractTrainingPhase, ::MyCallback, learner)`.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["3. Define what state the callback accesses and/or modifies by implementing\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" [`stateaccess`](#)`(::MyCallback)`. While `learner` is always passed as an\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" argument to `on` event handlers, by default a callback can not read or write\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" to its fields. See [`stateaccess`](#) for more detail.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" If a callback needs to write some state that other callbacks should be able\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" to access, it can store it in `learner.cbstate` if you add a permission in\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" `stateaccess`.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["4. If the callback needs some one-time initialization, you can implement [`init!`](#)\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" which will be run at least once before any step is run.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"const","children":[{"attributes":{},"tag":"const","children":["const"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Callback"},"tag":"reference","children":["Callback"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.SafeCallback"},"tag":"reference","children":["SafeCallback"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"abstract","children":[{"attributes":{},"tag":"abstract","children":["abstract"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"type","children":["type"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.UnsafeCallback"},"tag":"reference","children":["UnsafeCallback"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.AbstractCallback"},"tag":"reference","children":["AbstractCallback"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"p","children":["TODO: implement proper merging of permissions"],"type":"node"}],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" stateaccess(callback)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Return a named tuple determining what learner state `callback`\n"],"type":"node"},{"attributes":{},"tag":"String","children":["can access. The default is `(;)`, the empty named tuple, meaning\n"],"type":"node"},{"attributes":{},"tag":"String","children":["no state can be accessed. Implementations of `stateaccess` should\n"],"type":"node"},{"attributes":{},"tag":"String","children":["always return the least permissions possible.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["## Extending\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["For example, the [`ToGPU`](#) callback needs to write both the model and\n"],"type":"node"},{"attributes":{},"tag":"String","children":["the batch data, so its `stateaccess` implementation is:\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["```julia\n"],"type":"node"},{"attributes":{},"tag":"String","children":["stateaccess(::ToGPU) = (\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" model = Write(),\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" params = Write(),\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" step = (xs = Write(), ys = Write()),\n"],"type":"node"},{"attributes":{},"tag":"String","children":[")\n"],"type":"node"},{"attributes":{},"tag":"String","children":["```\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["When defining `stateaccess`, be careful that you do return a `NamedTuple`.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["`(x = Read(),)` is one but `(x = Read())` (without the comma) is parsed as\n"],"type":"node"},{"attributes":{},"tag":"String","children":["an assignment with value `Read()`.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.stateaccess"},"tag":"reference","children":["stateaccess"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Callback"},"tag":"reference","children":["Callback"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.runafter"},"tag":"reference","children":["runafter"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.AbstractCallback"},"tag":"reference","children":["AbstractCallback"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" abstract type ConflictResolution\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["A conflict resolution strategy for resolving write/write conflicts\n"],"type":"node"},{"attributes":{},"tag":"String","children":["of two callbacks.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["See [`resolveconflict`](#).\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"abstract","children":[{"attributes":{},"tag":"abstract","children":["abstract"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"type","children":["type"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ConflictResolution"},"tag":"reference","children":["ConflictResolution"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" abstract type NotDefined <: ConflictResolution\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["The default implementation of [`resolveconflict`](#). If a conflict\n"],"type":"node"},{"attributes":{},"tag":"String","children":["is detected, this ensures an error message is printed.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.NotDefined"},"tag":"reference","children":["NotDefined"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ConflictResolution"},"tag":"reference","children":["ConflictResolution"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" abstract type Unresolvable <: ConflictResolution\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Return from [`resolveconflict`](#) to indicate that two callbacks\n"],"type":"node"},{"attributes":{},"tag":"String","children":["are incompatible and cannot be used together.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Unresolvable"},"tag":"reference","children":["Unresolvable"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ConflictResolution"},"tag":"reference","children":["ConflictResolution"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" abstract type RunFirst <: ConflictResolution\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Return `RunFirst(cb1/cb2)` from [`resolveconflict`](#)`(cb1, cb2)` to indicate\n"],"type":"node"},{"attributes":{},"tag":"String","children":["that one of the callbacks should always run before the other.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.RunFirst"},"tag":"reference","children":["RunFirst"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ConflictResolution"},"tag":"reference","children":["ConflictResolution"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" abstract type NoConflict <: ConflictResolution\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Return from [`resolveconflict`](#) to indicate that, while the callbacks\n"],"type":"node"},{"attributes":{},"tag":"String","children":["modify the same state, they can be used together without any problems.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.NoConflict"},"tag":"reference","children":["NoConflict"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ConflictResolution"},"tag":"reference","children":["ConflictResolution"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["_resolveconflict"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb1"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb2"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["r"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.resolveconflict"},"tag":"reference","children":["resolveconflict"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb1"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb2"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["r"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"===","children":["==="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.NotDefined"},"tag":"reference","children":["NotDefined"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.resolveconflict"},"tag":"reference","children":["resolveconflict"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb2"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb1"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"else","children":["else"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["r"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" resolveconflict(cb1, cb2)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Define a conflict resolution strategy for resolving a write/write conflict\n"],"type":"node"},{"attributes":{},"tag":"String","children":["between two callbacks.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["The default is [`NotDefined()`], which will result in an error and a message\n"],"type":"node"},{"attributes":{},"tag":"String","children":["to implement this method.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["To implement, dispatch on the callback types that you which to resolve (in any\n"],"type":"node"},{"attributes":{},"tag":"String","children":["order) and return one of the following:\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- [`Unresolvable`](#)`()` if the callbacks must not be used together\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- [`RunFirst`](#)`(cb)` if one of the callbacks needs to run first; or\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- [`NoConflict`](#)`()` if the callbacks may run together in any order\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.resolveconflict"},"tag":"reference","children":["resolveconflict"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.AbstractCallback"},"tag":"reference","children":["AbstractCallback"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.AbstractCallback"},"tag":"reference","children":["AbstractCallback"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.NotDefined"},"tag":"reference","children":["NotDefined"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" abstract type FitException\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Abstract types for exceptions that can be thrown during fitting,\n"],"type":"node"},{"attributes":{},"tag":"String","children":["to change its control flow.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["See [`CancelStepException`](#), [`CancelEpochException`](#), [`CancelFittingException`](#).\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"abstract","children":[{"attributes":{},"tag":"abstract","children":["abstract"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"type","children":["type"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.FitException"},"tag":"reference","children":["FitException"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Exception"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" CancelStepException(message)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Throw during fitting to cancel the currently running step.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["This prematurely ends the current step without throwing an error.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Must be thrown inside the context of [`runstep`](#).\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["## Examples\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["```julia\n"],"type":"node"},{"attributes":{},"tag":"String","children":["runepoch(learner, phase) do _\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" for (xs, ys) in batches\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" runstep(learner, phase, (; xs, ys)) do _, state\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" # training logic...\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" if isnan(state.loss).\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" throw(CancelStepException(\"Skipping NaN loss\"))\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" end\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" end\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" end\n"],"type":"node"},{"attributes":{},"tag":"String","children":["end\n"],"type":"node"},{"attributes":{},"tag":"String","children":["```\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.CancelStepException"},"tag":"reference","children":["CancelStepException"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.FitException"},"tag":"reference","children":["FitException"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["msg"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["String"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" CancelEpochException(message)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Throw during fitting to cancel the currently running epoch.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["This prematurely ends the current epoch without throwing an error.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Must be thrown inside the context of [`runepoch`](#).\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["## Examples\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["```julia\n"],"type":"node"},{"attributes":{},"tag":"String","children":["runepoch(learner, phase) do _\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" for batch in batches\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" step!(learner, phase, batch)\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" if learner.step.loss < 1.\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" throw(CancelEpochException(\"Reached target loss\"))\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" end\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" end\n"],"type":"node"},{"attributes":{},"tag":"String","children":["end\n"],"type":"node"},{"attributes":{},"tag":"String","children":["```\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.CancelEpochException"},"tag":"reference","children":["CancelEpochException"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.FitException"},"tag":"reference","children":["FitException"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["msg"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["String"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" CancelFittingException(msg)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Throw during fitting to cancel it.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.CancelFittingException"},"tag":"reference","children":["CancelFittingException"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.FitException"},"tag":"reference","children":["FitException"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["msg"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["String"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"p","children":["Callback hook"],"type":"node"}],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" on(event::Event, phase::Phase, callback::AbstractCallback, learner)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Handle `event` with [`Callback`](#) `callback`.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["By default, this event handler does nothing for a callback.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["To see events which an `AbstractCallback` handles, use\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["```julia\n"],"type":"node"},{"attributes":{},"tag":"String","children":["methods(Training.on, (Any, Any, MyCallbackType, Any)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["```\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["## Extending\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["You can add event handlers to [`Callback`](#)s by implementing a method for `on`.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["See also [`Callback`](#) and [custom callbacks](documents/docs/callbacks/custom.md).\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["A method of `on` should *always* dispatch on the callback type, i.e.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["`on(event, phase, cb::MyCallback, learner)`. It may also dispatch on specific\n"],"type":"node"},{"attributes":{},"tag":"String","children":["[`Event`](#)s and [`Phase`](#). It should not dispatch on a specific type for\n"],"type":"node"},{"attributes":{},"tag":"String","children":["`learner`.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.on"},"tag":"reference","children":["on"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.Event"},"tag":"reference","children":["Event"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Callback"},"tag":"reference","children":["Callback"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"nothing","children":[""],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["_on"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["e"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["p"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.on"},"tag":"reference","children":["on"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["e"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["p"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["_on"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["e"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["p"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.SafeCallback"},"tag":"reference","children":["SafeCallback"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["perms"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"do","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["ChainRulesCore"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["ignore_derivatives"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"do","children":["do"],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.stateaccess"},"tag":"reference","children":["stateaccess"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.on"},"tag":"reference","children":["on"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["e"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["p"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.protect"},"tag":"reference","children":["protect"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["perms"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" init!(callback, learner)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Initialize a callback. Default is to do nothing.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["## Extending\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["To extend for a callback, implement `init!(cb::MyCallback, learner)`.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["`init!` can set up internal state of a callback that depends on `learner`\n"],"type":"node"},{"attributes":{},"tag":"String","children":["and can also initialize shared callback state in `learner.cbstate`.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Just like `on` event handlers, the state access permissions must be correctly\n"],"type":"node"},{"attributes":{},"tag":"String","children":["defined using [`stateaccess`](#) to do so.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["`init!` must also be idempotent, i.e. running it twice on the same `Learner`\n"],"type":"node"},{"attributes":{},"tag":"String","children":["should have the same effect as runnning it once.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.init!"},"tag":"reference","children":["init!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Callback"},"tag":"reference","children":["Callback"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"nothing","children":[""],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file diff --git a/data/FluxTraining@dev/src/callbacks/callbacks.jl.json b/data/FluxTraining@dev/src/callbacks/callbacks.jl.json index 3a7a2ff7b..42a5e7181 100644 --- a/data/FluxTraining@dev/src/callbacks/callbacks.jl.json +++ b/data/FluxTraining@dev/src/callbacks/callbacks.jl.json @@ -1 +1 @@ -{"attributes":{"backlinks":[],"path":"/home/runner/.julia/packages/FluxTraining/xCOPx/src/callbacks/callbacks.jl","package_id":"FluxTraining@dev","title":"FluxTraining/callbacks/callbacks.jl","module_id":"FluxTraining"},"tag":"sourcefile","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[],"type":"node"}],"type":"node"},{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"p","children":["ProgressPrinter"],"type":"node"}],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" ProgressPrinter()\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Prints a progress bar of the currently running epoch.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"mutable","children":["mutable"],"type":"node"},{"attributes":{},"tag":"true","children":[""],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ProgressPrinter"},"tag":"reference","children":["ProgressPrinter"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Callback"},"tag":"reference","children":["Callback"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["p"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"curly","children":[{"attributes":{},"tag":"Identifier","children":["Union"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Nothing"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Progress"],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ProgressPrinter"},"tag":"reference","children":["ProgressPrinter"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ProgressPrinter"},"tag":"reference","children":["ProgressPrinter"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["nothing"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Base"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["show"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["io"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["IO"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ProgressPrinter"},"tag":"reference","children":["ProgressPrinter"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["print"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["io"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["ProgressPrinter()"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.on"},"tag":"reference","children":["on"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.EpochBegin"},"tag":"reference","children":["EpochBegin"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.Phase"},"tag":"reference","children":["Phase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ProgressPrinter"},"tag":"reference","children":["ProgressPrinter"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["e"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["epochs"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"+","children":["+"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["1"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["dataiter"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["get"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.phasedataiter"},"tag":"reference","children":["phasedataiter"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["nothing"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["isnothing"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["dataiter"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["p"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["nothing"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["println"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Epoch "],"type":"node"},{"attributes":{},"tag":"$","children":["$"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["e"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"},{"attributes":{},"tag":"String","children":[" "],"type":"node"},{"attributes":{},"tag":"$","children":["$"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"},{"attributes":{},"tag":"String","children":[" ..."],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"else","children":["else"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["p"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["Progress"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["length"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["dataiter"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Epoch "],"type":"node"},{"attributes":{},"tag":"$","children":["$"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["e"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"},{"attributes":{},"tag":"String","children":[" "],"type":"node"},{"attributes":{},"tag":"$","children":["$"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"},{"attributes":{},"tag":"String","children":[": "],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.on"},"tag":"reference","children":["on"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.StepEnd"},"tag":"reference","children":["StepEnd"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.Phase"},"tag":"reference","children":["Phase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ProgressPrinter"},"tag":"reference","children":["ProgressPrinter"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"||","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["isnothing"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["p"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"||","children":["||"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["next!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["p"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.runafter"},"tag":"reference","children":["runafter"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ProgressPrinter"},"tag":"reference","children":["ProgressPrinter"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Recorder"},"tag":"reference","children":["Recorder"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.stateaccess"},"tag":"reference","children":["stateaccess"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ProgressPrinter"},"tag":"reference","children":["ProgressPrinter"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Read"},"tag":"reference","children":["Read"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Read"},"tag":"reference","children":["Read"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" MetricsPrinter() <: Callback\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Callback that prints metrics after every epoch. Relies on the metrics computed by\n"],"type":"node"},{"attributes":{},"tag":"String","children":["[`Metrics`](#), so will error if no `Metrics` callback is used.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["This callback is added by default to every [`Learner`](#) unless you pass in\n"],"type":"node"},{"attributes":{},"tag":"String","children":["`usedefaultcallbacks = false`.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.MetricsPrinter"},"tag":"reference","children":["MetricsPrinter"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Callback"},"tag":"reference","children":["Callback"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.on"},"tag":"reference","children":["on"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.EpochEnd"},"tag":"reference","children":["EpochEnd"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.Phase"},"tag":"reference","children":["Phase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.MetricsPrinter"},"tag":"reference","children":["MetricsPrinter"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["mvhistory"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["metricsepoch"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["epoch"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["epochs"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.print_epoch_table"},"tag":"reference","children":["print_epoch_table"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["mvhistory"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["epoch"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.print_epoch_table"},"tag":"reference","children":["print_epoch_table"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["mvhistory"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["epoch"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["header"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["vcat"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"vect","children":[{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Phase"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Epoch"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["string"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["keys"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["mvhistory"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["vals"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"comprehension","children":[{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"generator","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["last"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["mvhistory"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["key"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"|>","children":["|>"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["last"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"for","children":["for"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["key"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"in","children":["in"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["keys"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["mvhistory"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["reshape"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["vcat"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"vect","children":[{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["string"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["epoch"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["vals"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["1"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["pretty_table"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["header"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["header"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["formatters"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["PrettyTables"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["ft_round"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Integer","children":["5"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.stateaccess"},"tag":"reference","children":["stateaccess"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.MetricsPrinter"},"tag":"reference","children":["MetricsPrinter"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["metricsepoch"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Read"},"tag":"reference","children":["Read"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Read"},"tag":"reference","children":["Read"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.runafter"},"tag":"reference","children":["runafter"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.MetricsPrinter"},"tag":"reference","children":["MetricsPrinter"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Metrics"},"tag":"reference","children":["Metrics"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"p","children":["StopOnNaNLoss"],"type":"node"}],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" StopOnNaNLoss()\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Stops the training when a NaN loss is encountered.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["This callback is added by default to every [`Learner`](#) unless you pass in\n"],"type":"node"},{"attributes":{},"tag":"String","children":["`usedefaultcallbacks = false`.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.StopOnNaNLoss"},"tag":"reference","children":["StopOnNaNLoss"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Callback"},"tag":"reference","children":["Callback"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.on"},"tag":"reference","children":["on"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.BackwardEnd"},"tag":"reference","children":["BackwardEnd"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.AbstractTrainingPhase"},"tag":"reference","children":["AbstractTrainingPhase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.StopOnNaNLoss"},"tag":"reference","children":["StopOnNaNLoss"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"||","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"!","children":["!"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["isnan"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["step"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["loss"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"||","children":["||"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["throw"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.CancelFittingException"},"tag":"reference","children":["CancelFittingException"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Encountered NaN loss"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.stateaccess"},"tag":"reference","children":["stateaccess"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.StopOnNaNLoss"},"tag":"reference","children":["StopOnNaNLoss"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["step"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["loss"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Read"},"tag":"reference","children":["Read"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" ToDevice(movedatafn, movemodelfn) <: Callback\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Moves model and step data to a device using `movedatafn` for step data\n"],"type":"node"},{"attributes":{},"tag":"String","children":["and `movemodelfn` for the model. For example `ToDevice(Flux.gpu, Flux.gpu)`,\n"],"type":"node"},{"attributes":{},"tag":"String","children":["moves them to a GPU if available. See [`ToGPU`](#).\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["By default, only moves `step.xs` and `step.ys`, but this can be extended\n"],"type":"node"},{"attributes":{},"tag":"String","children":["to other state by implementing `on(::StepBegin, ::MyCustomPhase, ::ToDevice, learner)`.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ToDevice"},"tag":"reference","children":["ToDevice"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Callback"},"tag":"reference","children":["Callback"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["movedatafn"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["movemodelfn"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.on"},"tag":"reference","children":["on"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.EpochBegin"},"tag":"reference","children":["EpochBegin"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.Phase"},"tag":"reference","children":["Phase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ToDevice"},"tag":"reference","children":["ToDevice"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.model!"},"tag":"reference","children":["model!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["movemodelfn"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.stateaccess"},"tag":"reference","children":["stateaccess"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ToDevice"},"tag":"reference","children":["ToDevice"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Write"},"tag":"reference","children":["Write"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["params"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Write"},"tag":"reference","children":["Write"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["step"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Write"},"tag":"reference","children":["Write"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["optimizer"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Read"},"tag":"reference","children":["Read"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" ToGPU()\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Callback that moves model and batch data to the GPU during training.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Convenience for [`ToDevice`](#)`(Flux.gpu)`.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ToGPU"},"tag":"reference","children":["ToGPU"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ToDevice"},"tag":"reference","children":["ToDevice"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["gpu"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["gpu"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.on"},"tag":"reference","children":["on"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.StepBegin"},"tag":"reference","children":["StepBegin"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.Phase"},"tag":"reference","children":["Phase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ToDevice"},"tag":"reference","children":["ToDevice"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["step"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["xs"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["movedatafn"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["step"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["xs"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["step"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["ys"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["movedatafn"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["step"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["ys"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.garbagecollect"},"tag":"reference","children":["garbagecollect"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["GC"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["gc"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Base"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["Sys"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["islinux"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["ccall"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["malloc_trim"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Cvoid"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Cint"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["0"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" GarbageCollect(nsteps)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Every `nsteps` steps, forces garbage collection.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Use this if you get memory leaks from, for example,\n"],"type":"node"},{"attributes":{},"tag":"String","children":["parallel data loading.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Performs an additional C-call on Linux systems that can\n"],"type":"node"},{"attributes":{},"tag":"String","children":["sometimes help.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.GarbageCollect"},"tag":"reference","children":["GarbageCollect"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["nsteps"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Int"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["100"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.throttle"},"tag":"reference","children":["throttle"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.CustomCallback"},"tag":"reference","children":["CustomCallback"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"->","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"->","children":["->"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.garbagecollect"},"tag":"reference","children":["garbagecollect"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.StepEnd"},"tag":"reference","children":["StepEnd"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.Phase"},"tag":"reference","children":["Phase"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.StepEnd"},"tag":"reference","children":["StepEnd"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["freq"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["nsteps"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file +{"attributes":{"backlinks":[],"path":"/home/runner/.julia/packages/FluxTraining/imTF4/src/callbacks/callbacks.jl","package_id":"FluxTraining@dev","title":"FluxTraining/callbacks/callbacks.jl","module_id":"FluxTraining"},"tag":"sourcefile","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[],"type":"node"}],"type":"node"},{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"p","children":["ProgressPrinter"],"type":"node"}],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" ProgressPrinter()\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Prints a progress bar of the currently running epoch.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"mutable","children":["mutable"],"type":"node"},{"attributes":{},"tag":"true","children":[""],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ProgressPrinter"},"tag":"reference","children":["ProgressPrinter"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Callback"},"tag":"reference","children":["Callback"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["p"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"curly","children":[{"attributes":{},"tag":"Identifier","children":["Union"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Nothing"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Progress"],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ProgressPrinter"},"tag":"reference","children":["ProgressPrinter"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ProgressPrinter"},"tag":"reference","children":["ProgressPrinter"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["nothing"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Base"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["show"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["io"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["IO"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ProgressPrinter"},"tag":"reference","children":["ProgressPrinter"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["print"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["io"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["ProgressPrinter()"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.on"},"tag":"reference","children":["on"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.EpochBegin"},"tag":"reference","children":["EpochBegin"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.Phase"},"tag":"reference","children":["Phase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ProgressPrinter"},"tag":"reference","children":["ProgressPrinter"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["e"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["epochs"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"+","children":["+"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["1"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["dataiter"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["get"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.phasedataiter"},"tag":"reference","children":["phasedataiter"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["nothing"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["isnothing"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["dataiter"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["p"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["nothing"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["println"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Epoch "],"type":"node"},{"attributes":{},"tag":"$","children":["$"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["e"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"},{"attributes":{},"tag":"String","children":[" "],"type":"node"},{"attributes":{},"tag":"$","children":["$"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"},{"attributes":{},"tag":"String","children":[" ..."],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"else","children":["else"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["p"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["Progress"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["length"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["dataiter"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Epoch "],"type":"node"},{"attributes":{},"tag":"$","children":["$"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["e"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"},{"attributes":{},"tag":"String","children":[" "],"type":"node"},{"attributes":{},"tag":"$","children":["$"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"},{"attributes":{},"tag":"String","children":[": "],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.on"},"tag":"reference","children":["on"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.StepEnd"},"tag":"reference","children":["StepEnd"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.Phase"},"tag":"reference","children":["Phase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ProgressPrinter"},"tag":"reference","children":["ProgressPrinter"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"||","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["isnothing"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["p"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"||","children":["||"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["next!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["p"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.runafter"},"tag":"reference","children":["runafter"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ProgressPrinter"},"tag":"reference","children":["ProgressPrinter"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Recorder"},"tag":"reference","children":["Recorder"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.stateaccess"},"tag":"reference","children":["stateaccess"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ProgressPrinter"},"tag":"reference","children":["ProgressPrinter"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Read"},"tag":"reference","children":["Read"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Read"},"tag":"reference","children":["Read"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" MetricsPrinter() <: Callback\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Callback that prints metrics after every epoch. Relies on the metrics computed by\n"],"type":"node"},{"attributes":{},"tag":"String","children":["[`Metrics`](#), so will error if no `Metrics` callback is used.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["This callback is added by default to every [`Learner`](#) unless you pass in\n"],"type":"node"},{"attributes":{},"tag":"String","children":["`usedefaultcallbacks = false`.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.MetricsPrinter"},"tag":"reference","children":["MetricsPrinter"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Callback"},"tag":"reference","children":["Callback"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.on"},"tag":"reference","children":["on"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.EpochEnd"},"tag":"reference","children":["EpochEnd"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.Phase"},"tag":"reference","children":["Phase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.MetricsPrinter"},"tag":"reference","children":["MetricsPrinter"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["mvhistory"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["metricsepoch"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["epoch"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["epochs"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.print_epoch_table"},"tag":"reference","children":["print_epoch_table"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["mvhistory"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["epoch"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.print_epoch_table"},"tag":"reference","children":["print_epoch_table"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["mvhistory"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["epoch"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["header"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["vcat"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"vect","children":[{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Phase"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Epoch"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["string"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["keys"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["mvhistory"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["vals"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"comprehension","children":[{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"generator","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["last"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["mvhistory"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["key"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"|>","children":["|>"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["last"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"for","children":["for"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["key"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"in","children":["in"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["keys"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["mvhistory"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["reshape"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["vcat"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"vect","children":[{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["string"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["epoch"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["vals"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["1"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["pretty_table"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["header"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["header"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["formatters"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["PrettyTables"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["ft_round"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Integer","children":["5"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.stateaccess"},"tag":"reference","children":["stateaccess"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.MetricsPrinter"},"tag":"reference","children":["MetricsPrinter"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["metricsepoch"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Read"},"tag":"reference","children":["Read"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Read"},"tag":"reference","children":["Read"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.runafter"},"tag":"reference","children":["runafter"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.MetricsPrinter"},"tag":"reference","children":["MetricsPrinter"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Metrics"},"tag":"reference","children":["Metrics"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"p","children":["StopOnNaNLoss"],"type":"node"}],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" StopOnNaNLoss()\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Stops the training when a NaN loss is encountered.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["This callback is added by default to every [`Learner`](#) unless you pass in\n"],"type":"node"},{"attributes":{},"tag":"String","children":["`usedefaultcallbacks = false`.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.StopOnNaNLoss"},"tag":"reference","children":["StopOnNaNLoss"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Callback"},"tag":"reference","children":["Callback"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.on"},"tag":"reference","children":["on"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.BackwardEnd"},"tag":"reference","children":["BackwardEnd"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.AbstractTrainingPhase"},"tag":"reference","children":["AbstractTrainingPhase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.StopOnNaNLoss"},"tag":"reference","children":["StopOnNaNLoss"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"||","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"!","children":["!"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["isnan"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["step"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["loss"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"||","children":["||"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["throw"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.CancelFittingException"},"tag":"reference","children":["CancelFittingException"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Encountered NaN loss"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.stateaccess"},"tag":"reference","children":["stateaccess"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.StopOnNaNLoss"},"tag":"reference","children":["StopOnNaNLoss"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["step"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["loss"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Read"},"tag":"reference","children":["Read"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" ToDevice(movedatafn, movemodelfn) <: Callback\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Moves model and step data to a device using `movedatafn` for step data\n"],"type":"node"},{"attributes":{},"tag":"String","children":["and `movemodelfn` for the model. For example `ToDevice(Flux.gpu, Flux.gpu)`,\n"],"type":"node"},{"attributes":{},"tag":"String","children":["moves them to a GPU if available. See [`ToGPU`](#).\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["By default, only moves `step.xs` and `step.ys`, but this can be extended\n"],"type":"node"},{"attributes":{},"tag":"String","children":["to other state by implementing `on(::StepBegin, ::MyCustomPhase, ::ToDevice, learner)`.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ToDevice"},"tag":"reference","children":["ToDevice"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Callback"},"tag":"reference","children":["Callback"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["movedatafn"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["movemodelfn"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.on"},"tag":"reference","children":["on"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.EpochBegin"},"tag":"reference","children":["EpochBegin"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.Phase"},"tag":"reference","children":["Phase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ToDevice"},"tag":"reference","children":["ToDevice"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.model!"},"tag":"reference","children":["model!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["movemodelfn"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.stateaccess"},"tag":"reference","children":["stateaccess"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ToDevice"},"tag":"reference","children":["ToDevice"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Write"},"tag":"reference","children":["Write"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["params"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Write"},"tag":"reference","children":["Write"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["step"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Write"},"tag":"reference","children":["Write"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["optimizer"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Read"},"tag":"reference","children":["Read"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" ToGPU()\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Callback that moves model and batch data to the GPU during training.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Convenience for [`ToDevice`](#)`(Flux.gpu)`.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ToGPU"},"tag":"reference","children":["ToGPU"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ToDevice"},"tag":"reference","children":["ToDevice"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["gpu"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["gpu"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.on"},"tag":"reference","children":["on"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.StepBegin"},"tag":"reference","children":["StepBegin"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.Phase"},"tag":"reference","children":["Phase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ToDevice"},"tag":"reference","children":["ToDevice"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["step"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["xs"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["movedatafn"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["step"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["xs"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["step"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["ys"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["movedatafn"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["step"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["ys"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.garbagecollect"},"tag":"reference","children":["garbagecollect"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["GC"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["gc"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Base"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["Sys"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["islinux"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["ccall"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["malloc_trim"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Cvoid"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Cint"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["0"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" GarbageCollect(nsteps)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Every `nsteps` steps, forces garbage collection.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Use this if you get memory leaks from, for example,\n"],"type":"node"},{"attributes":{},"tag":"String","children":["parallel data loading.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Performs an additional C-call on Linux systems that can\n"],"type":"node"},{"attributes":{},"tag":"String","children":["sometimes help.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.GarbageCollect"},"tag":"reference","children":["GarbageCollect"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["nsteps"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Int"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["100"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.throttle"},"tag":"reference","children":["throttle"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.CustomCallback"},"tag":"reference","children":["CustomCallback"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"->","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"->","children":["->"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.garbagecollect"},"tag":"reference","children":["garbagecollect"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.StepEnd"},"tag":"reference","children":["StepEnd"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.Phase"},"tag":"reference","children":["Phase"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.StepEnd"},"tag":"reference","children":["StepEnd"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["freq"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["nsteps"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file diff --git a/data/FluxTraining@dev/src/callbacks/conditional.jl.json b/data/FluxTraining@dev/src/callbacks/conditional.jl.json index 499de68b4..46fb42f9f 100644 --- a/data/FluxTraining@dev/src/callbacks/conditional.jl.json +++ b/data/FluxTraining@dev/src/callbacks/conditional.jl.json @@ -1 +1 @@ -{"attributes":{"backlinks":[],"path":"/home/runner/.julia/packages/FluxTraining/xCOPx/src/callbacks/conditional.jl","package_id":"FluxTraining@dev","title":"FluxTraining/callbacks/conditional.jl","module_id":"FluxTraining"},"tag":"sourcefile","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[],"type":"node"}],"type":"node"},{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"p","children":["High-level interface"],"type":"node"}],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" throttle(callback, Event, freq = 1)\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" throttle(callback, Event, seconds = 1)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Throttle `Event` type for `callback` so that it is triggered either only every\n"],"type":"node"},{"attributes":{},"tag":"String","children":["`freq`'th time or every `seconds` seconds.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["## Examples\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["If you want to only sporadically log metrics ([`LogMetrics`](#)) or images\n"],"type":"node"},{"attributes":{},"tag":"String","children":["([`LogVisualization`](#)), `throttle` can be used as follows.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Every 10 steps:\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["```julia\n"],"type":"node"},{"attributes":{},"tag":"String","children":["callback = throttle(LogMetrics(TensorBoardBackend()), StepEnd, freq = 10)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["learner = Learner(; callbacks=[callback])\n"],"type":"node"},{"attributes":{},"tag":"String","children":["```\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Or every 5 seconds:\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["```julia\n"],"type":"node"},{"attributes":{},"tag":"String","children":["callback = throttle(LogMetrics(TensorBoardBackend()), StepEnd, seconds = 5)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["learner = Learner(; callbacks=[callback])\n"],"type":"node"},{"attributes":{},"tag":"String","children":["```\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.throttle"},"tag":"reference","children":["throttle"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["callback"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["event"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"curly","children":[{"attributes":{},"tag":"Identifier","children":["Type"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.Event"},"tag":"reference","children":["Event"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["freq"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["nothing"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["seconds"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["nothing"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"||","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["xor"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["isnothing"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["freq"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["isnothing"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["seconds"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"||","children":["||"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["error"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Pass either `every` OR `seconds`."],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"!","children":["!"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["isnothing"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["freq"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ConditionalCallback"},"tag":"reference","children":["ConditionalCallback"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["callback"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.FrequencyThrottle"},"tag":"reference","children":["FrequencyThrottle"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["freq"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["event"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"elseif","children":[{"attributes":{},"tag":"elseif","children":["elseif"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"!","children":["!"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["isnothing"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["seconds"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ConditionalCallback"},"tag":"reference","children":["ConditionalCallback"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["callback"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.TimeThrottle"},"tag":"reference","children":["TimeThrottle"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["seconds"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["event"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"p","children":["Implementation"],"type":"node"}],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" abstract type CallbackCondition\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Supertype for conditions to use with [`ConditionalCallback`](#).\n"],"type":"node"},{"attributes":{},"tag":"String","children":["To implement a `CallbackCondition`, implement\n"],"type":"node"},{"attributes":{},"tag":"String","children":["[`shouldrun`](#)`(::MyCondition, event, phase)`.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["See [`FrequencyThrottle`](#), [`TimeThrottle`](#) and [`throttle`](#).\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"abstract","children":[{"attributes":{},"tag":"abstract","children":["abstract"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"type","children":["type"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.CallbackCondition"},"tag":"reference","children":["CallbackCondition"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" ConditionalCallback(callback, condition) <: Callback\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Wrapper callback that only forwards events to the wrapped callback\n"],"type":"node"},{"attributes":{},"tag":"String","children":["if [`CallbackCondition`](#) `condition` is met. See [`throttle`](#).\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ConditionalCallback"},"tag":"reference","children":["ConditionalCallback"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Callback"},"tag":"reference","children":["Callback"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["callback"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Callback"},"tag":"reference","children":["Callback"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["condition"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.CallbackCondition"},"tag":"reference","children":["CallbackCondition"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.stateaccess"},"tag":"reference","children":["stateaccess"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["cc"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ConditionalCallback"},"tag":"reference","children":["ConditionalCallback"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.stateaccess"},"tag":"reference","children":["stateaccess"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["cc"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["callback"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.init!"},"tag":"reference","children":["init!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["cc"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ConditionalCallback"},"tag":"reference","children":["ConditionalCallback"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.init!"},"tag":"reference","children":["init!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["cc"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["callback"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.on"},"tag":"reference","children":["on"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["event"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.Event"},"tag":"reference","children":["Event"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.Phase"},"tag":"reference","children":["Phase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ConditionalCallback"},"tag":"reference","children":["ConditionalCallback"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.shouldrun"},"tag":"reference","children":["shouldrun"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["condition"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["event"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.on"},"tag":"reference","children":["on"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["event"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["callback"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"mutable","children":["mutable"],"type":"node"},{"attributes":{},"tag":"true","children":[""],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.FrequencyThrottle"},"tag":"reference","children":["FrequencyThrottle"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.CallbackCondition"},"tag":"reference","children":["CallbackCondition"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["freq"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["event"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["counter"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.FrequencyThrottle"},"tag":"reference","children":["FrequencyThrottle"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["f"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["e"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["new"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["f"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["e"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["1"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.shouldrun"},"tag":"reference","children":["shouldrun"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["c"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.FrequencyThrottle"},"tag":"reference","children":["FrequencyThrottle"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["event"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["typeof"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["event"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"==","children":["=="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["c"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["event"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["c"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["counter"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"==","children":["=="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["1"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["c"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["counter"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["c"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["freq"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"true","children":["true"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"else","children":["else"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"-=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["c"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["counter"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"-=","children":["-="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["1"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"false","children":["false"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"else","children":["else"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"true","children":["true"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"mutable","children":["mutable"],"type":"node"},{"attributes":{},"tag":"true","children":[""],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.TimeThrottle"},"tag":"reference","children":["TimeThrottle"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.CallbackCondition"},"tag":"reference","children":["CallbackCondition"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["seconds"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["event"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["timer"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.TimeThrottle"},"tag":"reference","children":["TimeThrottle"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["s"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["e"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["t"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["nothing"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["new"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["s"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["e"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["t"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.shouldrun"},"tag":"reference","children":["shouldrun"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["c"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.TimeThrottle"},"tag":"reference","children":["TimeThrottle"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["event"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["typeof"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["event"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"==","children":["=="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["c"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["event"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"||","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["isnothing"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["c"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["timer"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"||","children":["||"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["time"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"-","children":["-"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["c"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["timer"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":">","children":[">"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["c"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["seconds"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["c"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["timer"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["time"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"true","children":["true"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"else","children":["else"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"false","children":["false"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"else","children":["else"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"true","children":["true"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["testset"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["throttle"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"begin","children":["begin"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["train"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.testlearner"},"tag":"reference","children":["testlearner"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.epoch!"},"tag":"reference","children":["epoch!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.TrainingPhase"},"tag":"reference","children":["TrainingPhase"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.TrainingPhase"},"tag":"reference","children":["TrainingPhase"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["test"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["train"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Recorder"},"tag":"reference","children":["Recorder"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["steps"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"==","children":["=="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["16"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["testset"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["freq"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"begin","children":["begin"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["test"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["train"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.throttle"},"tag":"reference","children":["throttle"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Recorder"},"tag":"reference","children":["Recorder"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.StepEnd"},"tag":"reference","children":["StepEnd"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["freq"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["2"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["steps"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"==","children":["=="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["8"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["test"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["train"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.throttle"},"tag":"reference","children":["throttle"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Recorder"},"tag":"reference","children":["Recorder"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.StepEnd"},"tag":"reference","children":["StepEnd"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["freq"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["16"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["steps"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"==","children":["=="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["1"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"!","children":["!"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Base"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["Sys"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["iswindows"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["testset"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["seconds"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"begin","children":["begin"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["test"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["train"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.throttle"},"tag":"reference","children":["throttle"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Recorder"},"tag":"reference","children":["Recorder"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.StepEnd"},"tag":"reference","children":["StepEnd"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["seconds"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["0"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["steps"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"==","children":["=="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["16"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["test"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["train"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.throttle"},"tag":"reference","children":["throttle"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Recorder"},"tag":"reference","children":["Recorder"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.StepEnd"},"tag":"reference","children":["StepEnd"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["seconds"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["10"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["steps"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"==","children":["=="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["1"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file +{"attributes":{"backlinks":[],"path":"/home/runner/.julia/packages/FluxTraining/imTF4/src/callbacks/conditional.jl","package_id":"FluxTraining@dev","title":"FluxTraining/callbacks/conditional.jl","module_id":"FluxTraining"},"tag":"sourcefile","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[],"type":"node"}],"type":"node"},{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"p","children":["High-level interface"],"type":"node"}],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" throttle(callback, Event, freq = 1)\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" throttle(callback, Event, seconds = 1)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Throttle `Event` type for `callback` so that it is triggered either only every\n"],"type":"node"},{"attributes":{},"tag":"String","children":["`freq`'th time or every `seconds` seconds.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["## Examples\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["If you want to only sporadically log metrics ([`LogMetrics`](#)) or images\n"],"type":"node"},{"attributes":{},"tag":"String","children":["([`LogVisualization`](#)), `throttle` can be used as follows.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Every 10 steps:\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["```julia\n"],"type":"node"},{"attributes":{},"tag":"String","children":["callback = throttle(LogMetrics(TensorBoardBackend()), StepEnd, freq = 10)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["learner = Learner(; callbacks=[callback])\n"],"type":"node"},{"attributes":{},"tag":"String","children":["```\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Or every 5 seconds:\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["```julia\n"],"type":"node"},{"attributes":{},"tag":"String","children":["callback = throttle(LogMetrics(TensorBoardBackend()), StepEnd, seconds = 5)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["learner = Learner(; callbacks=[callback])\n"],"type":"node"},{"attributes":{},"tag":"String","children":["```\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.throttle"},"tag":"reference","children":["throttle"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["callback"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["event"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"curly","children":[{"attributes":{},"tag":"Identifier","children":["Type"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.Event"},"tag":"reference","children":["Event"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["freq"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["nothing"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["seconds"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["nothing"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"||","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["xor"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["isnothing"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["freq"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["isnothing"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["seconds"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"||","children":["||"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["error"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Pass either `every` OR `seconds`."],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"!","children":["!"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["isnothing"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["freq"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ConditionalCallback"},"tag":"reference","children":["ConditionalCallback"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["callback"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.FrequencyThrottle"},"tag":"reference","children":["FrequencyThrottle"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["freq"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["event"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"elseif","children":[{"attributes":{},"tag":"elseif","children":["elseif"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"!","children":["!"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["isnothing"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["seconds"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ConditionalCallback"},"tag":"reference","children":["ConditionalCallback"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["callback"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.TimeThrottle"},"tag":"reference","children":["TimeThrottle"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["seconds"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["event"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"p","children":["Implementation"],"type":"node"}],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" abstract type CallbackCondition\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Supertype for conditions to use with [`ConditionalCallback`](#).\n"],"type":"node"},{"attributes":{},"tag":"String","children":["To implement a `CallbackCondition`, implement\n"],"type":"node"},{"attributes":{},"tag":"String","children":["[`shouldrun`](#)`(::MyCondition, event, phase)`.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["See [`FrequencyThrottle`](#), [`TimeThrottle`](#) and [`throttle`](#).\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"abstract","children":[{"attributes":{},"tag":"abstract","children":["abstract"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"type","children":["type"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.CallbackCondition"},"tag":"reference","children":["CallbackCondition"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" ConditionalCallback(callback, condition) <: Callback\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Wrapper callback that only forwards events to the wrapped callback\n"],"type":"node"},{"attributes":{},"tag":"String","children":["if [`CallbackCondition`](#) `condition` is met. See [`throttle`](#).\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ConditionalCallback"},"tag":"reference","children":["ConditionalCallback"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Callback"},"tag":"reference","children":["Callback"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["callback"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Callback"},"tag":"reference","children":["Callback"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["condition"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.CallbackCondition"},"tag":"reference","children":["CallbackCondition"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.stateaccess"},"tag":"reference","children":["stateaccess"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["cc"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ConditionalCallback"},"tag":"reference","children":["ConditionalCallback"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.stateaccess"},"tag":"reference","children":["stateaccess"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["cc"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["callback"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.init!"},"tag":"reference","children":["init!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["cc"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ConditionalCallback"},"tag":"reference","children":["ConditionalCallback"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.init!"},"tag":"reference","children":["init!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["cc"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["callback"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.on"},"tag":"reference","children":["on"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["event"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.Event"},"tag":"reference","children":["Event"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.Phase"},"tag":"reference","children":["Phase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ConditionalCallback"},"tag":"reference","children":["ConditionalCallback"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.shouldrun"},"tag":"reference","children":["shouldrun"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["condition"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["event"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.on"},"tag":"reference","children":["on"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["event"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["callback"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"mutable","children":["mutable"],"type":"node"},{"attributes":{},"tag":"true","children":[""],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.FrequencyThrottle"},"tag":"reference","children":["FrequencyThrottle"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.CallbackCondition"},"tag":"reference","children":["CallbackCondition"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["freq"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["event"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["counter"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.FrequencyThrottle"},"tag":"reference","children":["FrequencyThrottle"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["f"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["e"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["new"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["f"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["e"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["1"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.shouldrun"},"tag":"reference","children":["shouldrun"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["c"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.FrequencyThrottle"},"tag":"reference","children":["FrequencyThrottle"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["event"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["typeof"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["event"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"==","children":["=="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["c"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["event"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["c"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["counter"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"==","children":["=="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["1"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["c"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["counter"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["c"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["freq"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"true","children":["true"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"else","children":["else"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"-=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["c"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["counter"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"-=","children":["-="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["1"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"false","children":["false"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"else","children":["else"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"true","children":["true"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"mutable","children":["mutable"],"type":"node"},{"attributes":{},"tag":"true","children":[""],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.TimeThrottle"},"tag":"reference","children":["TimeThrottle"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.CallbackCondition"},"tag":"reference","children":["CallbackCondition"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["seconds"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["event"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["timer"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.TimeThrottle"},"tag":"reference","children":["TimeThrottle"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["s"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["e"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["t"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["nothing"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["new"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["s"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["e"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["t"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.shouldrun"},"tag":"reference","children":["shouldrun"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["c"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.TimeThrottle"},"tag":"reference","children":["TimeThrottle"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["event"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["typeof"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["event"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"==","children":["=="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["c"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["event"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"||","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["isnothing"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["c"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["timer"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"||","children":["||"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["time"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"-","children":["-"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["c"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["timer"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":">","children":[">"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["c"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["seconds"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["c"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["timer"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["time"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"true","children":["true"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"else","children":["else"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"false","children":["false"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"else","children":["else"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"true","children":["true"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["testset"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["throttle"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"begin","children":["begin"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["train"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.testlearner"},"tag":"reference","children":["testlearner"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.epoch!"},"tag":"reference","children":["epoch!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.TrainingPhase"},"tag":"reference","children":["TrainingPhase"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.TrainingPhase"},"tag":"reference","children":["TrainingPhase"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["test"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["train"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Recorder"},"tag":"reference","children":["Recorder"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["steps"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"==","children":["=="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["16"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["testset"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["freq"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"begin","children":["begin"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["test"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["train"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.throttle"},"tag":"reference","children":["throttle"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Recorder"},"tag":"reference","children":["Recorder"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.StepEnd"},"tag":"reference","children":["StepEnd"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["freq"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["2"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["steps"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"==","children":["=="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["8"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["test"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["train"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.throttle"},"tag":"reference","children":["throttle"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Recorder"},"tag":"reference","children":["Recorder"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.StepEnd"},"tag":"reference","children":["StepEnd"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["freq"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["16"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["steps"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"==","children":["=="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["1"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"!","children":["!"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Base"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["Sys"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["iswindows"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["testset"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["seconds"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"begin","children":["begin"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["test"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["train"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.throttle"},"tag":"reference","children":["throttle"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Recorder"},"tag":"reference","children":["Recorder"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.StepEnd"},"tag":"reference","children":["StepEnd"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["seconds"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["0"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["steps"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"==","children":["=="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["16"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["test"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["train"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.throttle"},"tag":"reference","children":["throttle"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Recorder"},"tag":"reference","children":["Recorder"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.StepEnd"},"tag":"reference","children":["StepEnd"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["seconds"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["10"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["steps"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"==","children":["=="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["1"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file diff --git a/data/FluxTraining@dev/src/callbacks/custom.jl.json b/data/FluxTraining@dev/src/callbacks/custom.jl.json index 82b9c404f..be74dbc71 100644 --- a/data/FluxTraining@dev/src/callbacks/custom.jl.json +++ b/data/FluxTraining@dev/src/callbacks/custom.jl.json @@ -1 +1 @@ -{"attributes":{"backlinks":[],"path":"/home/runner/.julia/packages/FluxTraining/xCOPx/src/callbacks/custom.jl","package_id":"FluxTraining@dev","title":"FluxTraining/callbacks/custom.jl","module_id":"FluxTraining"},"tag":"sourcefile","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" CustomCallback(f, Event, [TPhase = Phase, access = (;)])\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["A callback that runs `f(learner)` every time an event of type `Event`\n"],"type":"node"},{"attributes":{},"tag":"String","children":["during a phase of type in `Phase`.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["If `f` needs to access learner state, pass `access`, a named tuple\n"],"type":"node"},{"attributes":{},"tag":"String","children":["in the same form as [`stateaccess`](#).\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Instead of using [`CustomCallback`](#) it is recommended to properly\n"],"type":"node"},{"attributes":{},"tag":"String","children":["implement a [`Callback`](#).\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["## Examples\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["We can get a quick idea of when a new epoch starts as follows:\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["```julia\n"],"type":"node"},{"attributes":{},"tag":"String","children":["cb = CustomCallback(learner -> println(\"New epoch!\"), EpochBegin)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["```\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"mutable","children":["mutable"],"type":"node"},{"attributes":{},"tag":"true","children":[""],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"curly","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.CustomCallback"},"tag":"reference","children":["CustomCallback"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Identifier","children":["E"],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.Event"},"tag":"reference","children":["Event"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Identifier","children":["P"],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.Phase"},"tag":"reference","children":["Phase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Callback"},"tag":"reference","children":["Callback"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["f"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Any"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["access"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.CustomCallback"},"tag":"reference","children":["CustomCallback"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["f"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["E"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"curly","children":[{"attributes":{},"tag":"Identifier","children":["Type"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.Event"},"tag":"reference","children":["Event"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["P"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"curly","children":[{"attributes":{},"tag":"Identifier","children":["Type"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.Phase"},"tag":"reference","children":["Phase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.Phase"},"tag":"reference","children":["Phase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["access"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"curly","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.CustomCallback"},"tag":"reference","children":["CustomCallback"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["E"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["P"],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["f"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["access"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.stateaccess"},"tag":"reference","children":["stateaccess"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["cc"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.CustomCallback"},"tag":"reference","children":["CustomCallback"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["cc"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["access"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"where","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.on"},"tag":"reference","children":["on"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["E"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["P"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"curly","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.CustomCallback"},"tag":"reference","children":["CustomCallback"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["E"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Identifier","children":["P"],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"where","children":["where"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Identifier","children":["E"],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.Event"},"tag":"reference","children":["Event"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Identifier","children":["P"],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.Phase"},"tag":"reference","children":["Phase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["f"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["testset"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["CustomCallback"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"begin","children":["begin"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["testset"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Basic"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"begin","children":["begin"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["x"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["0"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.CustomCallback"},"tag":"reference","children":["CustomCallback"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"->","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"->","children":["->"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"+=","children":[{"attributes":{},"tag":"Identifier","children":["x"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"+=","children":["+="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["1"],"type":"node"}],"type":"node"},{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.StepBegin"},"tag":"reference","children":["StepBegin"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.testlearner"},"tag":"reference","children":["testlearner"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.epoch!"},"tag":"reference","children":["epoch!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.TrainingPhase"},"tag":"reference","children":["TrainingPhase"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["test"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["x"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"==","children":["=="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["16"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["testset"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Interrupt"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"begin","children":["begin"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"do","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.CustomCallback"},"tag":"reference","children":["CustomCallback"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events"},"tag":"reference","children":["Events"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.StepEnd"},"tag":"reference","children":["StepEnd"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.TrainingPhase"},"tag":"reference","children":["TrainingPhase"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"do","children":["do"],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["throw"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.CancelFittingException"},"tag":"reference","children":["CancelFittingException"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["test"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.testlearner"},"tag":"reference","children":["testlearner"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Recorder"},"tag":"reference","children":["Recorder"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["coeff"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["3"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["test_throws"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.CancelFittingException"},"tag":"reference","children":["CancelFittingException"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.epoch!"},"tag":"reference","children":["epoch!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.TrainingPhase"},"tag":"reference","children":["TrainingPhase"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["test"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.TrainingPhase"},"tag":"reference","children":["TrainingPhase"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["epochs"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"==","children":["=="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["0"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["test"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.TrainingPhase"},"tag":"reference","children":["TrainingPhase"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["steps"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"==","children":["=="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["0"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file +{"attributes":{"backlinks":[],"path":"/home/runner/.julia/packages/FluxTraining/imTF4/src/callbacks/custom.jl","package_id":"FluxTraining@dev","title":"FluxTraining/callbacks/custom.jl","module_id":"FluxTraining"},"tag":"sourcefile","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" CustomCallback(f, Event, [TPhase = Phase, access = (;)])\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["A callback that runs `f(learner)` every time an event of type `Event`\n"],"type":"node"},{"attributes":{},"tag":"String","children":["during a phase of type in `Phase`.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["If `f` needs to access learner state, pass `access`, a named tuple\n"],"type":"node"},{"attributes":{},"tag":"String","children":["in the same form as [`stateaccess`](#).\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Instead of using [`CustomCallback`](#) it is recommended to properly\n"],"type":"node"},{"attributes":{},"tag":"String","children":["implement a [`Callback`](#).\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["## Examples\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["We can get a quick idea of when a new epoch starts as follows:\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["```julia\n"],"type":"node"},{"attributes":{},"tag":"String","children":["cb = CustomCallback(learner -> println(\"New epoch!\"), EpochBegin)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["```\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"mutable","children":["mutable"],"type":"node"},{"attributes":{},"tag":"true","children":[""],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"curly","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.CustomCallback"},"tag":"reference","children":["CustomCallback"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Identifier","children":["E"],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.Event"},"tag":"reference","children":["Event"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Identifier","children":["P"],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.Phase"},"tag":"reference","children":["Phase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Callback"},"tag":"reference","children":["Callback"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["f"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Any"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["access"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.CustomCallback"},"tag":"reference","children":["CustomCallback"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["f"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["E"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"curly","children":[{"attributes":{},"tag":"Identifier","children":["Type"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.Event"},"tag":"reference","children":["Event"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["P"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"curly","children":[{"attributes":{},"tag":"Identifier","children":["Type"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.Phase"},"tag":"reference","children":["Phase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.Phase"},"tag":"reference","children":["Phase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["access"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"curly","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.CustomCallback"},"tag":"reference","children":["CustomCallback"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["E"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["P"],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["f"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["access"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.stateaccess"},"tag":"reference","children":["stateaccess"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["cc"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.CustomCallback"},"tag":"reference","children":["CustomCallback"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["cc"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["access"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"where","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.on"},"tag":"reference","children":["on"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["E"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["P"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"curly","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.CustomCallback"},"tag":"reference","children":["CustomCallback"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["E"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Identifier","children":["P"],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"where","children":["where"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Identifier","children":["E"],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.Event"},"tag":"reference","children":["Event"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Identifier","children":["P"],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.Phase"},"tag":"reference","children":["Phase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["f"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["testset"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["CustomCallback"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"begin","children":["begin"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["testset"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Basic"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"begin","children":["begin"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["x"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["0"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.CustomCallback"},"tag":"reference","children":["CustomCallback"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"->","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"->","children":["->"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"+=","children":[{"attributes":{},"tag":"Identifier","children":["x"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"+=","children":["+="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["1"],"type":"node"}],"type":"node"},{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.StepBegin"},"tag":"reference","children":["StepBegin"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.testlearner"},"tag":"reference","children":["testlearner"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.epoch!"},"tag":"reference","children":["epoch!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.TrainingPhase"},"tag":"reference","children":["TrainingPhase"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["test"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["x"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"==","children":["=="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["16"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["testset"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Interrupt"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"begin","children":["begin"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"do","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.CustomCallback"},"tag":"reference","children":["CustomCallback"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events"},"tag":"reference","children":["Events"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.StepEnd"},"tag":"reference","children":["StepEnd"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.TrainingPhase"},"tag":"reference","children":["TrainingPhase"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"do","children":["do"],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["throw"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.CancelFittingException"},"tag":"reference","children":["CancelFittingException"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["test"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.testlearner"},"tag":"reference","children":["testlearner"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Recorder"},"tag":"reference","children":["Recorder"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["coeff"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["3"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["test_throws"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.CancelFittingException"},"tag":"reference","children":["CancelFittingException"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.epoch!"},"tag":"reference","children":["epoch!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.TrainingPhase"},"tag":"reference","children":["TrainingPhase"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["test"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.TrainingPhase"},"tag":"reference","children":["TrainingPhase"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["epochs"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"==","children":["=="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["0"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["test"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.TrainingPhase"},"tag":"reference","children":["TrainingPhase"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["steps"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"==","children":["=="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["0"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file diff --git a/data/FluxTraining@dev/src/callbacks/earlystopping.jl.json b/data/FluxTraining@dev/src/callbacks/earlystopping.jl.json index 2081c758a..00adf4fdd 100644 --- a/data/FluxTraining@dev/src/callbacks/earlystopping.jl.json +++ b/data/FluxTraining@dev/src/callbacks/earlystopping.jl.json @@ -1 +1 @@ -{"attributes":{"backlinks":[],"path":"/home/runner/.julia/packages/FluxTraining/xCOPx/src/callbacks/earlystopping.jl","package_id":"FluxTraining@dev","title":"FluxTraining/callbacks/earlystopping.jl","module_id":"FluxTraining"},"tag":"sourcefile","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[],"type":"node"}],"type":"node"},{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"p","children":["Early stopping"],"type":"node"}],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" EarlyStopping(criteria...; kwargs...)\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" EarlyStopping(n)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Stop training early when `criteria` are met. See\n"],"type":"node"},{"attributes":{},"tag":"String","children":["[EarlyStopping.jl](https://github.com/ablaom/EarlyStopping.jl) for available stopping\n"],"type":"node"},{"attributes":{},"tag":"String","children":["criteria.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Passing an integer `n` uses the simple patience criterion: stop if the\n"],"type":"node"},{"attributes":{},"tag":"String","children":["validation loss hasn't decreased for `n` epochs.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["You can control which phases are taken to measure the out-of-sample loss\n"],"type":"node"},{"attributes":{},"tag":"String","children":["and the training loss with keyword arguments `trainphase` (default\n"],"type":"node"},{"attributes":{},"tag":"String","children":["[`AbstractTrainingPhase`](#)) and `testphase` (default [`AbstractValidationPhase`](#)).\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["## Examples\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["```julia\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Learner(model, lossfn, callbacks=[EarlyStopping(3)])\n"],"type":"node"},{"attributes":{},"tag":"String","children":["```\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["```julia\n"],"type":"node"},{"attributes":{},"tag":"String","children":["import FluxTraining.ES: Disjunction, InvalidValue, TimeLimit\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["callback = EarlyStopping(Disjunction(InvalidValue(), TimeLimit(0.5)))\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Learner(model, lossfn, callbacks=[callback])\n"],"type":"node"},{"attributes":{},"tag":"String","children":["```\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"mutable","children":["mutable"],"type":"node"},{"attributes":{},"tag":"true","children":[""],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.EarlyStopping"},"tag":"reference","children":["EarlyStopping"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Callback"},"tag":"reference","children":["Callback"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["criterion"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ES"},"tag":"reference","children":["ES"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["StoppingCriterion"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["testphase"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"curly","children":[{"attributes":{},"tag":"Identifier","children":["Type"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.Phase"},"tag":"reference","children":["Phase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["trainphase"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"curly","children":[{"attributes":{},"tag":"Identifier","children":["Type"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.Phase"},"tag":"reference","children":["Phase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.EarlyStopping"},"tag":"reference","children":["EarlyStopping"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["criterion"],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["testphase"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.AbstractValidationPhase"},"tag":"reference","children":["AbstractValidationPhase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["trainphase"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.AbstractTrainingPhase"},"tag":"reference","children":["AbstractTrainingPhase"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"||","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["testphase"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"isa","children":["isa"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["trainphase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"||","children":["||"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["trainphase"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"isa","children":["isa"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["testphase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["error"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["`trainphase` and `testphase` must not be subtypes of one another"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.EarlyStopping"},"tag":"reference","children":["EarlyStopping"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["criterion"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["nothing"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["testphase"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["trainphase"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.EarlyStopping"},"tag":"reference","children":["EarlyStopping"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["n"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Int"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"...","children":[{"attributes":{},"tag":"Identifier","children":["kwargs"],"type":"node"},{"attributes":{},"tag":"...","children":["..."],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.EarlyStopping"},"tag":"reference","children":["EarlyStopping"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ES"},"tag":"reference","children":["ES"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["Patience"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["n"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"...","children":[{"attributes":{},"tag":"Identifier","children":["kwargs"],"type":"node"},{"attributes":{},"tag":"...","children":["..."],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Base"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["show"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["io"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["IO"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.EarlyStopping"},"tag":"reference","children":["EarlyStopping"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["print"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["io"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["EarlyStopping("],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["criterion"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":[")"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.on"},"tag":"reference","children":["on"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.EpochEnd"},"tag":"reference","children":["EpochEnd"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.Phase"},"tag":"reference","children":["Phase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.EarlyStopping"},"tag":"reference","children":["EarlyStopping"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["loss"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["last"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["metricsepoch"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loss"},"tag":"reference","children":["Loss"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Integer","children":["2"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"isa","children":["isa"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["testphase"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["isnothing"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ES"},"tag":"reference","children":["ES"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.EarlyStopping"},"tag":"reference","children":["EarlyStopping"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["update"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["criterion"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["loss"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"else","children":["else"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ES"},"tag":"reference","children":["ES"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.EarlyStopping"},"tag":"reference","children":["EarlyStopping"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["update"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["criterion"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["loss"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"elseif","children":[{"attributes":{},"tag":"elseif","children":["elseif"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"isa","children":["isa"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["trainphase"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["isnothing"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ES"},"tag":"reference","children":["ES"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.EarlyStopping"},"tag":"reference","children":["EarlyStopping"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["update_training"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["criterion"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["loss"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"else","children":["else"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ES"},"tag":"reference","children":["ES"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.EarlyStopping"},"tag":"reference","children":["EarlyStopping"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["update_training"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["criterion"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["loss"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"&&","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"!","children":["!"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["isnothing"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"&&","children":["&&"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ES"},"tag":"reference","children":["ES"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.EarlyStopping"},"tag":"reference","children":["EarlyStopping"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["done"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["criterion"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["throw"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.CancelFittingException"},"tag":"reference","children":["CancelFittingException"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ES"},"tag":"reference","children":["ES"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.EarlyStopping"},"tag":"reference","children":["EarlyStopping"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["message"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["criterion"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.stateaccess"},"tag":"reference","children":["stateaccess"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.EarlyStopping"},"tag":"reference","children":["EarlyStopping"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["metricsepoch"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Read"},"tag":"reference","children":["Read"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.runafter"},"tag":"reference","children":["runafter"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.EarlyStopping"},"tag":"reference","children":["EarlyStopping"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Metrics"},"tag":"reference","children":["Metrics"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file +{"attributes":{"backlinks":[],"path":"/home/runner/.julia/packages/FluxTraining/imTF4/src/callbacks/earlystopping.jl","package_id":"FluxTraining@dev","title":"FluxTraining/callbacks/earlystopping.jl","module_id":"FluxTraining"},"tag":"sourcefile","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[],"type":"node"}],"type":"node"},{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"p","children":["Early stopping"],"type":"node"}],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" EarlyStopping(criteria...; kwargs...)\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" EarlyStopping(n)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Stop training early when `criteria` are met. See\n"],"type":"node"},{"attributes":{},"tag":"String","children":["[EarlyStopping.jl](https://github.com/ablaom/EarlyStopping.jl) for available stopping\n"],"type":"node"},{"attributes":{},"tag":"String","children":["criteria.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Passing an integer `n` uses the simple patience criterion: stop if the\n"],"type":"node"},{"attributes":{},"tag":"String","children":["validation loss hasn't decreased for `n` epochs.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["You can control which phases are taken to measure the out-of-sample loss\n"],"type":"node"},{"attributes":{},"tag":"String","children":["and the training loss with keyword arguments `trainphase` (default\n"],"type":"node"},{"attributes":{},"tag":"String","children":["[`AbstractTrainingPhase`](#)) and `testphase` (default [`AbstractValidationPhase`](#)).\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["## Examples\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["```julia\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Learner(model, lossfn, callbacks=[EarlyStopping(3)])\n"],"type":"node"},{"attributes":{},"tag":"String","children":["```\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["```julia\n"],"type":"node"},{"attributes":{},"tag":"String","children":["import FluxTraining.ES: Disjunction, InvalidValue, TimeLimit\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["callback = EarlyStopping(Disjunction(InvalidValue(), TimeLimit(0.5)))\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Learner(model, lossfn, callbacks=[callback])\n"],"type":"node"},{"attributes":{},"tag":"String","children":["```\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"mutable","children":["mutable"],"type":"node"},{"attributes":{},"tag":"true","children":[""],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.EarlyStopping"},"tag":"reference","children":["EarlyStopping"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Callback"},"tag":"reference","children":["Callback"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["criterion"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ES"},"tag":"reference","children":["ES"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["StoppingCriterion"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["testphase"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"curly","children":[{"attributes":{},"tag":"Identifier","children":["Type"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.Phase"},"tag":"reference","children":["Phase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["trainphase"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"curly","children":[{"attributes":{},"tag":"Identifier","children":["Type"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.Phase"},"tag":"reference","children":["Phase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.EarlyStopping"},"tag":"reference","children":["EarlyStopping"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["criterion"],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["testphase"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.AbstractValidationPhase"},"tag":"reference","children":["AbstractValidationPhase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["trainphase"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.AbstractTrainingPhase"},"tag":"reference","children":["AbstractTrainingPhase"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"||","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["testphase"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"isa","children":["isa"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["trainphase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"||","children":["||"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["trainphase"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"isa","children":["isa"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["testphase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["error"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["`trainphase` and `testphase` must not be subtypes of one another"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.EarlyStopping"},"tag":"reference","children":["EarlyStopping"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["criterion"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["nothing"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["testphase"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["trainphase"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.EarlyStopping"},"tag":"reference","children":["EarlyStopping"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["n"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Int"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"...","children":[{"attributes":{},"tag":"Identifier","children":["kwargs"],"type":"node"},{"attributes":{},"tag":"...","children":["..."],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.EarlyStopping"},"tag":"reference","children":["EarlyStopping"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ES"},"tag":"reference","children":["ES"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["Patience"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["n"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"...","children":[{"attributes":{},"tag":"Identifier","children":["kwargs"],"type":"node"},{"attributes":{},"tag":"...","children":["..."],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Base"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["show"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["io"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["IO"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.EarlyStopping"},"tag":"reference","children":["EarlyStopping"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["print"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["io"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["EarlyStopping("],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["criterion"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":[")"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.on"},"tag":"reference","children":["on"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.EpochEnd"},"tag":"reference","children":["EpochEnd"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.Phase"},"tag":"reference","children":["Phase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.EarlyStopping"},"tag":"reference","children":["EarlyStopping"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["loss"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["last"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["metricsepoch"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loss"},"tag":"reference","children":["Loss"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Integer","children":["2"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"isa","children":["isa"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["testphase"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["isnothing"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ES"},"tag":"reference","children":["ES"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.EarlyStopping"},"tag":"reference","children":["EarlyStopping"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["update"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["criterion"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["loss"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"else","children":["else"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ES"},"tag":"reference","children":["ES"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.EarlyStopping"},"tag":"reference","children":["EarlyStopping"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["update"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["criterion"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["loss"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"elseif","children":[{"attributes":{},"tag":"elseif","children":["elseif"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"isa","children":["isa"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["trainphase"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["isnothing"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ES"},"tag":"reference","children":["ES"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.EarlyStopping"},"tag":"reference","children":["EarlyStopping"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["update_training"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["criterion"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["loss"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"else","children":["else"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ES"},"tag":"reference","children":["ES"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.EarlyStopping"},"tag":"reference","children":["EarlyStopping"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["update_training"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["criterion"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["loss"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"&&","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"!","children":["!"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["isnothing"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"&&","children":["&&"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ES"},"tag":"reference","children":["ES"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.EarlyStopping"},"tag":"reference","children":["EarlyStopping"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["done"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["criterion"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["throw"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.CancelFittingException"},"tag":"reference","children":["CancelFittingException"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ES"},"tag":"reference","children":["ES"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.EarlyStopping"},"tag":"reference","children":["EarlyStopping"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["message"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["criterion"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.stateaccess"},"tag":"reference","children":["stateaccess"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.EarlyStopping"},"tag":"reference","children":["EarlyStopping"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["metricsepoch"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Read"},"tag":"reference","children":["Read"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.runafter"},"tag":"reference","children":["runafter"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.EarlyStopping"},"tag":"reference","children":["EarlyStopping"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Metrics"},"tag":"reference","children":["Metrics"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file diff --git a/data/FluxTraining@dev/src/callbacks/events.jl.json b/data/FluxTraining@dev/src/callbacks/events.jl.json index af6c2c216..ca6fb0733 100644 --- a/data/FluxTraining@dev/src/callbacks/events.jl.json +++ b/data/FluxTraining@dev/src/callbacks/events.jl.json @@ -1 +1 @@ -{"attributes":{"backlinks":[],"path":"/home/runner/.julia/packages/FluxTraining/xCOPx/src/callbacks/events.jl","package_id":"FluxTraining@dev","title":"FluxTraining/callbacks/events.jl","module_id":"FluxTraining"},"tag":"sourcefile","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" module Events\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Provides the abstract [`Event`](#) type and concrete event types.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Events in [`TrainingPhase`](#) and [`ValidationPhase`](#):\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- [`EpochBegin`](#) and [`EpochEnd`](#), called at the beginning and end of each\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" epoch.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- [`StepBegin`](#) and [`StepEnd`](#), called at the beginning and end of each\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" batch.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- [`LossBegin`](#), called after the forward pass but before the loss calculation.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["[`TrainingPhase`](#) only:\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- [`BackwardBegin`](#), called after forward pass and loss calculation but before gradient\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" calculation.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- [`BackwardEnd`](#), called after gradient calculation but before parameter update.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"module","children":[{"attributes":{},"tag":"module","children":["module"],"type":"node"},{"attributes":{},"tag":"true","children":[""],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events"},"tag":"reference","children":["Events"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" abstract type Event\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Abstract type for events that callbacks can hook into\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"abstract","children":[{"attributes":{},"tag":"abstract","children":["abstract"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"type","children":["type"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.Event"},"tag":"reference","children":["Event"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" EpochBegin()\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["[`Event`](#) called at the beginning of an epoch.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.EpochBegin"},"tag":"reference","children":["EpochBegin"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.Event"},"tag":"reference","children":["Event"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" EpochEnd()\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["[`Event`](#) called at the end of an epoch.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.EpochEnd"},"tag":"reference","children":["EpochEnd"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.Event"},"tag":"reference","children":["Event"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" StepBegin()\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["[`Event`](#) called at the beginning of a batch.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.StepBegin"},"tag":"reference","children":["StepBegin"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.Event"},"tag":"reference","children":["Event"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" StepEnd()\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["[`Event`](#) called at the end of a batch.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.StepEnd"},"tag":"reference","children":["StepEnd"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.Event"},"tag":"reference","children":["Event"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" LossBegin()\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["[`Event`](#) called between calculating `y_pred` and calculating loss\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.LossBegin"},"tag":"reference","children":["LossBegin"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.Event"},"tag":"reference","children":["Event"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" BackwardBegin()\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["[`Event`](#) called between calculating loss and calculating gradients\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.BackwardBegin"},"tag":"reference","children":["BackwardBegin"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.Event"},"tag":"reference","children":["Event"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" BackwardEnd()\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["[`Event`](#) called between calculating gradients and updating parameters.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.BackwardEnd"},"tag":"reference","children":["BackwardEnd"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.Event"},"tag":"reference","children":["Event"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"export","children":[{"attributes":{},"tag":"export","children":["export"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Comment","children":["# abstract"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.Event"},"tag":"reference","children":["Event"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Comment","children":["# concrete"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.EpochBegin"},"tag":"reference","children":["EpochBegin"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.EpochEnd"},"tag":"reference","children":["EpochEnd"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.StepBegin"},"tag":"reference","children":["StepBegin"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.StepEnd"},"tag":"reference","children":["StepEnd"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.LossBegin"},"tag":"reference","children":["LossBegin"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.BackwardBegin"},"tag":"reference","children":["BackwardBegin"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.BackwardEnd"},"tag":"reference","children":["BackwardEnd"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"p","children":["module"],"type":"node"}],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events"},"tag":"reference","children":["Events"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file +{"attributes":{"backlinks":[],"path":"/home/runner/.julia/packages/FluxTraining/imTF4/src/callbacks/events.jl","package_id":"FluxTraining@dev","title":"FluxTraining/callbacks/events.jl","module_id":"FluxTraining"},"tag":"sourcefile","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" module Events\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Provides the abstract [`Event`](#) type and concrete event types.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Events in [`TrainingPhase`](#) and [`ValidationPhase`](#):\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- [`EpochBegin`](#) and [`EpochEnd`](#), called at the beginning and end of each\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" epoch.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- [`StepBegin`](#) and [`StepEnd`](#), called at the beginning and end of each\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" batch.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- [`LossBegin`](#), called after the forward pass but before the loss calculation.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["[`TrainingPhase`](#) only:\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- [`BackwardBegin`](#), called after forward pass and loss calculation but before gradient\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" calculation.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- [`BackwardEnd`](#), called after gradient calculation but before parameter update.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"module","children":[{"attributes":{},"tag":"module","children":["module"],"type":"node"},{"attributes":{},"tag":"true","children":[""],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events"},"tag":"reference","children":["Events"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" abstract type Event\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Abstract type for events that callbacks can hook into\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"abstract","children":[{"attributes":{},"tag":"abstract","children":["abstract"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"type","children":["type"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.Event"},"tag":"reference","children":["Event"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" EpochBegin()\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["[`Event`](#) called at the beginning of an epoch.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.EpochBegin"},"tag":"reference","children":["EpochBegin"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.Event"},"tag":"reference","children":["Event"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" EpochEnd()\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["[`Event`](#) called at the end of an epoch.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.EpochEnd"},"tag":"reference","children":["EpochEnd"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.Event"},"tag":"reference","children":["Event"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" StepBegin()\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["[`Event`](#) called at the beginning of a batch.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.StepBegin"},"tag":"reference","children":["StepBegin"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.Event"},"tag":"reference","children":["Event"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" StepEnd()\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["[`Event`](#) called at the end of a batch.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.StepEnd"},"tag":"reference","children":["StepEnd"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.Event"},"tag":"reference","children":["Event"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" LossBegin()\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["[`Event`](#) called between calculating `y_pred` and calculating loss\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.LossBegin"},"tag":"reference","children":["LossBegin"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.Event"},"tag":"reference","children":["Event"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" BackwardBegin()\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["[`Event`](#) called between calculating loss and calculating gradients\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.BackwardBegin"},"tag":"reference","children":["BackwardBegin"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.Event"},"tag":"reference","children":["Event"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" BackwardEnd()\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["[`Event`](#) called between calculating gradients and updating parameters.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.BackwardEnd"},"tag":"reference","children":["BackwardEnd"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.Event"},"tag":"reference","children":["Event"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"export","children":[{"attributes":{},"tag":"export","children":["export"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Comment","children":["# abstract"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.Event"},"tag":"reference","children":["Event"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Comment","children":["# concrete"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.EpochBegin"},"tag":"reference","children":["EpochBegin"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.EpochEnd"},"tag":"reference","children":["EpochEnd"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.StepBegin"},"tag":"reference","children":["StepBegin"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.StepEnd"},"tag":"reference","children":["StepEnd"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.LossBegin"},"tag":"reference","children":["LossBegin"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.BackwardBegin"},"tag":"reference","children":["BackwardBegin"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.BackwardEnd"},"tag":"reference","children":["BackwardEnd"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"p","children":["module"],"type":"node"}],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events"},"tag":"reference","children":["Events"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file diff --git a/data/FluxTraining@dev/src/callbacks/execution.jl.json b/data/FluxTraining@dev/src/callbacks/execution.jl.json index a8f08637d..8c9dd8de2 100644 --- a/data/FluxTraining@dev/src/callbacks/execution.jl.json +++ b/data/FluxTraining@dev/src/callbacks/execution.jl.json @@ -1 +1 @@ -{"attributes":{"backlinks":[],"path":"/home/runner/.julia/packages/FluxTraining/xCOPx/src/callbacks/execution.jl","package_id":"FluxTraining@dev","title":"FluxTraining/callbacks/execution.jl","module_id":"FluxTraining"},"tag":"sourcefile","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"abstract","children":[{"attributes":{},"tag":"abstract","children":["abstract"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"type","children":["type"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.CallbackRunner"},"tag":"reference","children":["CallbackRunner"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.LinearRunner"},"tag":"reference","children":["LinearRunner"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.CallbackRunner"},"tag":"reference","children":["CallbackRunner"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.handle"},"tag":"reference","children":["handle"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["runner"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.LinearRunner"},"tag":"reference","children":["LinearRunner"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["event"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.Event"},"tag":"reference","children":["Event"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["idxs"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"do","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["ChainRulesCore"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["ignore_derivatives"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"do","children":["do"],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["topological_sort_by_dfs"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["graph"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"for","children":[{"attributes":{},"tag":"for","children":["for"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["i"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"in","children":["in"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["idxs"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["_on"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["event"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbs"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["i"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file +{"attributes":{"backlinks":[],"path":"/home/runner/.julia/packages/FluxTraining/imTF4/src/callbacks/execution.jl","package_id":"FluxTraining@dev","title":"FluxTraining/callbacks/execution.jl","module_id":"FluxTraining"},"tag":"sourcefile","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"abstract","children":[{"attributes":{},"tag":"abstract","children":["abstract"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"type","children":["type"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.CallbackRunner"},"tag":"reference","children":["CallbackRunner"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.LinearRunner"},"tag":"reference","children":["LinearRunner"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.CallbackRunner"},"tag":"reference","children":["CallbackRunner"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.handle"},"tag":"reference","children":["handle"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["runner"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.LinearRunner"},"tag":"reference","children":["LinearRunner"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["event"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.Event"},"tag":"reference","children":["Event"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["idxs"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"do","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["ChainRulesCore"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["ignore_derivatives"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"do","children":["do"],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["topological_sort_by_dfs"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["graph"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"for","children":[{"attributes":{},"tag":"for","children":["for"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["i"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"in","children":["in"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["idxs"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["_on"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["event"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbs"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["i"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file diff --git a/data/FluxTraining@dev/src/callbacks/graph.jl.json b/data/FluxTraining@dev/src/callbacks/graph.jl.json index 49daaf2ba..963c298e1 100644 --- a/data/FluxTraining@dev/src/callbacks/graph.jl.json +++ b/data/FluxTraining@dev/src/callbacks/graph.jl.json @@ -1 +1 @@ -{"attributes":{"backlinks":[],"path":"/home/runner/.julia/packages/FluxTraining/xCOPx/src/callbacks/graph.jl","package_id":"FluxTraining@dev","title":"FluxTraining/callbacks/graph.jl","module_id":"FluxTraining"},"tag":"sourcefile","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[],"type":"node"}],"type":"node"},{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"p","children":["TOOD: check for reads on :cbstate without a previous write (missing callback) TODO: check for cyclical dependencies"],"type":"node"}],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" callbackgraph(callbacks) -> SimpleDiGraph\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Creates a directed acyclic graph from a list of `callbacks`.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Ordering is given through `runafter` and `resolveconflict`.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["If a write conflict cannot be resolved (i.e. `resolveconflict`)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["is not implemented), throws an error.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.callbackgraph"},"tag":"reference","children":["callbackgraph"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Comment","children":["# create a graph"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["g"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["SimpleDiGraph"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["length"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Comment","children":["# add dependencies defined through `runafter`"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["foreach"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"->","children":[{"attributes":{},"tag":"Identifier","children":["e"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"->","children":["->"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["add_edge!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["g"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["e"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.edgesrunafter"},"tag":"reference","children":["edgesrunafter"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["permissions"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.stateaccess"},"tag":"reference","children":["stateaccess"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["writeaccesses"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"comprehension","children":[{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"generator","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.accesses"},"tag":"reference","children":["accesses"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ps"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Write"},"tag":"reference","children":["Write"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"for","children":["for"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ps"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"in","children":["in"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["permissions"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["readaccesses"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"comprehension","children":[{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"generator","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.accesses"},"tag":"reference","children":["accesses"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ps"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Read"},"tag":"reference","children":["Read"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"for","children":["for"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ps"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"in","children":["in"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["permissions"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Comment","children":["# detect write-write conflicts and handle them"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"for","children":[{"attributes":{},"tag":"for","children":["for"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["i"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["j"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["accessi"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["accessj"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"in","children":["in"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.findconflicts"},"tag":"reference","children":["findconflicts"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["writeaccesses"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["writeaccesses"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"!","children":["!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"||","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["has_edge"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["g"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["i"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["j"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"||","children":["||"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["has_edge"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["g"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["j"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["i"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"Identifier","children":["cb1"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb2"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["i"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["j"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["resolution"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.resolveconflict"},"tag":"reference","children":["resolveconflict"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb1"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb2"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["resolution"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"isa","children":["isa"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.NotDefined"},"tag":"reference","children":["NotDefined"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.errorwriteconflict"},"tag":"reference","children":["errorwriteconflict"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb1"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb2"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["accessi"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["accessj"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["resolvable"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"true","children":["true"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["resolution"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"isa","children":["isa"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Unresolvable"},"tag":"reference","children":["Unresolvable"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.errorwriteconflict"},"tag":"reference","children":["errorwriteconflict"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb1"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb2"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["accessi"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["accessj"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["resolvable"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"false","children":["false"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"elseif","children":[{"attributes":{},"tag":"elseif","children":["elseif"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["resolution"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"isa","children":["isa"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.RunFirst"},"tag":"reference","children":["RunFirst"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["resolution"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"===","children":["==="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb1"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["add_edge!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["g"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb1"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb2"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"else","children":["else"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["add_edge!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["g"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb2"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb1"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Comment","children":["# resolution isa NoConflict"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"else","children":["else"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"continue","children":["continue"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Comment","children":["# detect read-write conflicts and handle them"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Comment","children":["# writes will be places before reads!"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"for","children":[{"attributes":{},"tag":"for","children":["for"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["i"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["j"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"in","children":["in"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.findconflicts"},"tag":"reference","children":["findconflicts"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["writeaccesses"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["readaccesses"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["resolution"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.resolveconflict"},"tag":"reference","children":["resolveconflict"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["i"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["j"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"&&","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["resolution"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"isa","children":["isa"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.RunFirst"},"tag":"reference","children":["RunFirst"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"&&","children":["&&"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["resolution"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"==","children":["=="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["j"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["add_edge!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["g"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["j"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["i"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"else","children":["else"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["add_edge!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["g"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["i"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["j"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Comment","children":["# TODO: check if callback state is read without being written"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Comment","children":["# TODO: check for cyclical dependencies"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["g"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.findconflicts"},"tag":"reference","children":["findconflicts"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["accesses1"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["accesses2"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["conflicts"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"vect","children":[{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"for","children":[{"attributes":{},"tag":"for","children":["for"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["i"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["j"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"in","children":["in"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Iterators"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["product"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Integer","children":["1"],"type":"node"},{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["length"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["accesses1"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Integer","children":["1"],"type":"node"},{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["length"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["accesses2"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["i"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"!=","children":["!="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["j"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"for","children":[{"attributes":{},"tag":"for","children":["for"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["a1"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["a2"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"in","children":["in"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Iterators"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["product"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":"Identifier","children":["accesses1"],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["i"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":"Identifier","children":["accesses2"],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["j"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.hasconflict"},"tag":"reference","children":["hasconflict"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["a1"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["a2"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["push!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["conflicts"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["i"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["j"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["a1"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["a2"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["conflicts"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" edgesrunafter(callbacks)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Return a vector of `Edge`s representing dependencies\n"],"type":"node"},{"attributes":{},"tag":"String","children":["defined by `runafter`.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.edgesrunafter"},"tag":"reference","children":["edgesrunafter"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["edges"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":"curly","children":[{"attributes":{},"tag":"Identifier","children":["Edge"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Int"],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"for","children":[{"attributes":{},"tag":"for","children":["for"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["i"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"in","children":["in"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["enumerate"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["Ts"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.runafter"},"tag":"reference","children":["runafter"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"for","children":[{"attributes":{},"tag":"for","children":["for"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["j"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["othercb"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"in","children":["in"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["enumerate"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["any"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"comprehension","children":[{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"generator","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["othercb"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"isa","children":["isa"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["T"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"for","children":["for"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["T"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"in","children":["in"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Ts"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["push!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["edges"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["Edge"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["j"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["i"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["edges"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" accesses()\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Enumerate all valid state accesses of permissions of kind `perm`.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["`accesses((x = Read(),), Read()) === [(:x,)]`\n"],"type":"node"},{"attributes":{},"tag":"String","children":["`accesses((x = Read(),), Write()) === []`\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.accesses"},"tag":"reference","children":["accesses"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["permissions"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["NamedTuple"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["P"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"curly","children":[{"attributes":{},"tag":"Identifier","children":["Type"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Permission"},"tag":"reference","children":["Permission"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Permission"},"tag":"reference","children":["Permission"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["a"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"vect","children":[{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["prefix"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"for","children":[{"attributes":{},"tag":"for","children":["for"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["field"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["perm"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"in","children":["in"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["zip"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["keys"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["permissions"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["permissions"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["perm"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"isa","children":["isa"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["P"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["push!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["a"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"...","children":[{"attributes":{},"tag":"Identifier","children":["prefix"],"type":"node"},{"attributes":{},"tag":"...","children":["..."],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["field"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"elseif","children":[{"attributes":{},"tag":"elseif","children":["elseif"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["perm"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"isa","children":["isa"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["NamedTuple"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.accesses"},"tag":"reference","children":["accesses"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["perm"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["P"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["a"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"...","children":[{"attributes":{},"tag":"Identifier","children":["prefix"],"type":"node"},{"attributes":{},"tag":"...","children":["..."],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["field"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["a"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"where","children":[{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.hasconflict"},"tag":"reference","children":["hasconflict"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["access1"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["T1"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["access2"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["T2"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Bool"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"where","children":["where"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Identifier","children":["T1"],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Tuple"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Identifier","children":["T2"],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Tuple"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"Identifier","children":["l1"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["l2"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["length"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["access1"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["length"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["access2"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"||","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["l1"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":">","children":[">"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["0"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"||","children":["||"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"false","children":["false"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"||","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["l2"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":">","children":[">"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["0"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"||","children":["||"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"false","children":["false"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":"Identifier","children":["access1"],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Integer","children":["1"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"!=","children":["!="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":"Identifier","children":["access2"],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Integer","children":["1"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"false","children":["false"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"elseif","children":[{"attributes":{},"tag":"elseif","children":["elseif"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"||","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["l1"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"==","children":["=="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["1"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"||","children":["||"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["l2"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"==","children":["=="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["1"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"true","children":["true"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"else","children":["else"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.hasconflict"},"tag":"reference","children":["hasconflict"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":"Identifier","children":["access1"],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Integer","children":["2"],"type":"node"},{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":"Identifier","children":["access2"],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Integer","children":["2"],"type":"node"},{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.errorwriteconflict"},"tag":"reference","children":["errorwriteconflict"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb1"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb2"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["access1"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["access2"],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["resolvable"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"true","children":["true"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["msg"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"String","children":["Write conflict detected between "],"type":"node"},{"attributes":{},"tag":"$","children":["$"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb1"],"type":"node"},{"attributes":{},"tag":"String","children":[" and "],"type":"node"},{"attributes":{},"tag":"$","children":["$"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb2"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"},{"attributes":{},"tag":"String","children":["!\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"String","children":["- "],"type":"node"},{"attributes":{},"tag":"$","children":["$"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb1"],"type":"node"},{"attributes":{},"tag":"String","children":[" writes to "],"type":"node"},{"attributes":{},"tag":"$","children":["$"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.formataccess"},"tag":"reference","children":["formataccess"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["access1"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"String","children":["- "],"type":"node"},{"attributes":{},"tag":"$","children":["$"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb2"],"type":"node"},{"attributes":{},"tag":"String","children":[" writes to "],"type":"node"},{"attributes":{},"tag":"$","children":["$"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.formataccess"},"tag":"reference","children":["formataccess"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["access2"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["resolvable"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"*=","children":[{"attributes":{},"tag":"Identifier","children":["msg"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"*=","children":["*="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"String","children":["To resolve this, implement:\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"String","children":["`resolveconflict(::"],"type":"node"},{"attributes":{},"tag":"$","children":["$"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["typeof"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb1"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"},{"attributes":{},"tag":"String","children":[", ::"],"type":"node"},{"attributes":{},"tag":"$","children":["$"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["typeof"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb2"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"},{"attributes":{},"tag":"String","children":[")`\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"String","children":["See also `resolveconflict` and `ConflictResolution`.\n"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"else","children":["else"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"*=","children":[{"attributes":{},"tag":"Identifier","children":["msg"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"*=","children":["*="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"String","children":["Both callbacks cannot be used together, please remove one.\n"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["error"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["msg"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.formataccess"},"tag":"reference","children":["formataccess"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["access"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["join"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["string"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["access"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Char","children":["'.'"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" iterpairs(a)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Iterators over the Cartesian product of `a` with itself,\n"],"type":"node"},{"attributes":{},"tag":"String","children":["skipping any pairs `(a, b)` where `a == b`.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.iterpairs"},"tag":"reference","children":["iterpairs"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["a"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["AbstractArray"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["filter"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"->","children":[{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["i"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["j"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"->","children":["->"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["i"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"!=","children":["!="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["j"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Iterators"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["product"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Integer","children":["1"],"type":"node"},{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Integer","children":["9"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Integer","children":["1"],"type":"node"},{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Integer","children":["9"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"|>","children":["|>"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["collect"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file +{"attributes":{"backlinks":[],"path":"/home/runner/.julia/packages/FluxTraining/imTF4/src/callbacks/graph.jl","package_id":"FluxTraining@dev","title":"FluxTraining/callbacks/graph.jl","module_id":"FluxTraining"},"tag":"sourcefile","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[],"type":"node"}],"type":"node"},{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"p","children":["TOOD: check for reads on :cbstate without a previous write (missing callback) TODO: check for cyclical dependencies"],"type":"node"}],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" callbackgraph(callbacks) -> SimpleDiGraph\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Creates a directed acyclic graph from a list of `callbacks`.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Ordering is given through `runafter` and `resolveconflict`.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["If a write conflict cannot be resolved (i.e. `resolveconflict`)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["is not implemented), throws an error.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.callbackgraph"},"tag":"reference","children":["callbackgraph"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Comment","children":["# create a graph"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["g"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["SimpleDiGraph"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["length"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Comment","children":["# add dependencies defined through `runafter`"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["foreach"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"->","children":[{"attributes":{},"tag":"Identifier","children":["e"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"->","children":["->"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["add_edge!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["g"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["e"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.edgesrunafter"},"tag":"reference","children":["edgesrunafter"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["permissions"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.stateaccess"},"tag":"reference","children":["stateaccess"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["writeaccesses"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"comprehension","children":[{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"generator","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.accesses"},"tag":"reference","children":["accesses"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ps"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Write"},"tag":"reference","children":["Write"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"for","children":["for"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ps"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"in","children":["in"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["permissions"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["readaccesses"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"comprehension","children":[{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"generator","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.accesses"},"tag":"reference","children":["accesses"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ps"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Read"},"tag":"reference","children":["Read"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"for","children":["for"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ps"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"in","children":["in"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["permissions"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Comment","children":["# detect write-write conflicts and handle them"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"for","children":[{"attributes":{},"tag":"for","children":["for"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["i"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["j"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["accessi"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["accessj"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"in","children":["in"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.findconflicts"},"tag":"reference","children":["findconflicts"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["writeaccesses"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["writeaccesses"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"!","children":["!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"||","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["has_edge"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["g"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["i"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["j"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"||","children":["||"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["has_edge"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["g"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["j"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["i"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"Identifier","children":["cb1"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb2"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["i"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["j"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["resolution"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.resolveconflict"},"tag":"reference","children":["resolveconflict"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb1"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb2"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["resolution"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"isa","children":["isa"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.NotDefined"},"tag":"reference","children":["NotDefined"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.errorwriteconflict"},"tag":"reference","children":["errorwriteconflict"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb1"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb2"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["accessi"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["accessj"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["resolvable"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"true","children":["true"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["resolution"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"isa","children":["isa"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Unresolvable"},"tag":"reference","children":["Unresolvable"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.errorwriteconflict"},"tag":"reference","children":["errorwriteconflict"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb1"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb2"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["accessi"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["accessj"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["resolvable"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"false","children":["false"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"elseif","children":[{"attributes":{},"tag":"elseif","children":["elseif"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["resolution"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"isa","children":["isa"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.RunFirst"},"tag":"reference","children":["RunFirst"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["resolution"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"===","children":["==="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb1"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["add_edge!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["g"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb1"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb2"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"else","children":["else"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["add_edge!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["g"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb2"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb1"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Comment","children":["# resolution isa NoConflict"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"else","children":["else"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"continue","children":["continue"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Comment","children":["# detect read-write conflicts and handle them"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Comment","children":["# writes will be places before reads!"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"for","children":[{"attributes":{},"tag":"for","children":["for"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["i"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["j"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"in","children":["in"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.findconflicts"},"tag":"reference","children":["findconflicts"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["writeaccesses"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["readaccesses"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["resolution"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.resolveconflict"},"tag":"reference","children":["resolveconflict"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["i"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["j"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"&&","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["resolution"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"isa","children":["isa"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.RunFirst"},"tag":"reference","children":["RunFirst"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"&&","children":["&&"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["resolution"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"==","children":["=="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["j"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["add_edge!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["g"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["j"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["i"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"else","children":["else"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["add_edge!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["g"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["i"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["j"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Comment","children":["# TODO: check if callback state is read without being written"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Comment","children":["# TODO: check for cyclical dependencies"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["g"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.findconflicts"},"tag":"reference","children":["findconflicts"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["accesses1"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["accesses2"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["conflicts"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"vect","children":[{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"for","children":[{"attributes":{},"tag":"for","children":["for"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["i"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["j"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"in","children":["in"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Iterators"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["product"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Integer","children":["1"],"type":"node"},{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["length"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["accesses1"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Integer","children":["1"],"type":"node"},{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["length"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["accesses2"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["i"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"!=","children":["!="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["j"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"for","children":[{"attributes":{},"tag":"for","children":["for"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["a1"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["a2"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"in","children":["in"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Iterators"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["product"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":"Identifier","children":["accesses1"],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["i"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":"Identifier","children":["accesses2"],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["j"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.hasconflict"},"tag":"reference","children":["hasconflict"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["a1"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["a2"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["push!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["conflicts"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["i"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["j"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["a1"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["a2"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["conflicts"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" edgesrunafter(callbacks)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Return a vector of `Edge`s representing dependencies\n"],"type":"node"},{"attributes":{},"tag":"String","children":["defined by `runafter`.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.edgesrunafter"},"tag":"reference","children":["edgesrunafter"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["edges"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":"curly","children":[{"attributes":{},"tag":"Identifier","children":["Edge"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Int"],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"for","children":[{"attributes":{},"tag":"for","children":["for"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["i"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"in","children":["in"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["enumerate"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["Ts"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.runafter"},"tag":"reference","children":["runafter"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"for","children":[{"attributes":{},"tag":"for","children":["for"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["j"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["othercb"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"in","children":["in"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["enumerate"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["any"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"comprehension","children":[{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"generator","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["othercb"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"isa","children":["isa"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["T"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"for","children":["for"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["T"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"in","children":["in"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Ts"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["push!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["edges"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["Edge"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["j"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["i"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["edges"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" accesses()\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Enumerate all valid state accesses of permissions of kind `perm`.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["`accesses((x = Read(),), Read()) === [(:x,)]`\n"],"type":"node"},{"attributes":{},"tag":"String","children":["`accesses((x = Read(),), Write()) === []`\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.accesses"},"tag":"reference","children":["accesses"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["permissions"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["NamedTuple"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["P"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"curly","children":[{"attributes":{},"tag":"Identifier","children":["Type"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Permission"},"tag":"reference","children":["Permission"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Permission"},"tag":"reference","children":["Permission"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["a"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"vect","children":[{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["prefix"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"for","children":[{"attributes":{},"tag":"for","children":["for"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["field"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["perm"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"in","children":["in"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["zip"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["keys"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["permissions"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["permissions"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["perm"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"isa","children":["isa"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["P"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["push!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["a"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"...","children":[{"attributes":{},"tag":"Identifier","children":["prefix"],"type":"node"},{"attributes":{},"tag":"...","children":["..."],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["field"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"elseif","children":[{"attributes":{},"tag":"elseif","children":["elseif"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["perm"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"isa","children":["isa"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["NamedTuple"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.accesses"},"tag":"reference","children":["accesses"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["perm"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["P"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["a"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"...","children":[{"attributes":{},"tag":"Identifier","children":["prefix"],"type":"node"},{"attributes":{},"tag":"...","children":["..."],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["field"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["a"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"where","children":[{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.hasconflict"},"tag":"reference","children":["hasconflict"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["access1"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["T1"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["access2"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["T2"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Bool"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"where","children":["where"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Identifier","children":["T1"],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Tuple"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Identifier","children":["T2"],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Tuple"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"Identifier","children":["l1"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["l2"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["length"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["access1"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["length"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["access2"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"||","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["l1"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":">","children":[">"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["0"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"||","children":["||"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"false","children":["false"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"||","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["l2"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":">","children":[">"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["0"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"||","children":["||"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"false","children":["false"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":"Identifier","children":["access1"],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Integer","children":["1"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"!=","children":["!="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":"Identifier","children":["access2"],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Integer","children":["1"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"false","children":["false"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"elseif","children":[{"attributes":{},"tag":"elseif","children":["elseif"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"||","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["l1"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"==","children":["=="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["1"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"||","children":["||"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["l2"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"==","children":["=="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["1"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"true","children":["true"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"else","children":["else"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.hasconflict"},"tag":"reference","children":["hasconflict"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":"Identifier","children":["access1"],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Integer","children":["2"],"type":"node"},{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":"Identifier","children":["access2"],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Integer","children":["2"],"type":"node"},{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.errorwriteconflict"},"tag":"reference","children":["errorwriteconflict"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb1"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb2"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["access1"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["access2"],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["resolvable"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"true","children":["true"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["msg"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"String","children":["Write conflict detected between "],"type":"node"},{"attributes":{},"tag":"$","children":["$"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb1"],"type":"node"},{"attributes":{},"tag":"String","children":[" and "],"type":"node"},{"attributes":{},"tag":"$","children":["$"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb2"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"},{"attributes":{},"tag":"String","children":["!\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"String","children":["- "],"type":"node"},{"attributes":{},"tag":"$","children":["$"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb1"],"type":"node"},{"attributes":{},"tag":"String","children":[" writes to "],"type":"node"},{"attributes":{},"tag":"$","children":["$"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.formataccess"},"tag":"reference","children":["formataccess"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["access1"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"String","children":["- "],"type":"node"},{"attributes":{},"tag":"$","children":["$"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb2"],"type":"node"},{"attributes":{},"tag":"String","children":[" writes to "],"type":"node"},{"attributes":{},"tag":"$","children":["$"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.formataccess"},"tag":"reference","children":["formataccess"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["access2"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["resolvable"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"*=","children":[{"attributes":{},"tag":"Identifier","children":["msg"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"*=","children":["*="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"String","children":["To resolve this, implement:\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"String","children":["`resolveconflict(::"],"type":"node"},{"attributes":{},"tag":"$","children":["$"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["typeof"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb1"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"},{"attributes":{},"tag":"String","children":[", ::"],"type":"node"},{"attributes":{},"tag":"$","children":["$"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["typeof"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb2"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"},{"attributes":{},"tag":"String","children":[")`\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"String","children":["See also `resolveconflict` and `ConflictResolution`.\n"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"else","children":["else"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"*=","children":[{"attributes":{},"tag":"Identifier","children":["msg"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"*=","children":["*="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"String","children":["Both callbacks cannot be used together, please remove one.\n"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["error"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["msg"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.formataccess"},"tag":"reference","children":["formataccess"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["access"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["join"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["string"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["access"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Char","children":["'.'"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" iterpairs(a)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Iterators over the Cartesian product of `a` with itself,\n"],"type":"node"},{"attributes":{},"tag":"String","children":["skipping any pairs `(a, b)` where `a == b`.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.iterpairs"},"tag":"reference","children":["iterpairs"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["a"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["AbstractArray"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["filter"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"->","children":[{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["i"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["j"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"->","children":["->"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["i"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"!=","children":["!="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["j"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Iterators"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["product"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Integer","children":["1"],"type":"node"},{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Integer","children":["9"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Integer","children":["1"],"type":"node"},{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Integer","children":["9"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"|>","children":["|>"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["collect"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file diff --git a/data/FluxTraining@dev/src/callbacks/hyperparameters.jl.json b/data/FluxTraining@dev/src/callbacks/hyperparameters.jl.json index 8631ab58e..7664db324 100644 --- a/data/FluxTraining@dev/src/callbacks/hyperparameters.jl.json +++ b/data/FluxTraining@dev/src/callbacks/hyperparameters.jl.json @@ -1 +1 @@ -{"attributes":{"backlinks":[],"path":"/home/runner/.julia/packages/FluxTraining/xCOPx/src/callbacks/hyperparameters.jl","package_id":"FluxTraining@dev","title":"FluxTraining/callbacks/hyperparameters.jl","module_id":"FluxTraining"},"tag":"sourcefile","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"p","children":["Hyperparameter interface"],"type":"node"}],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" HyperParameter{T}\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["A hyperparameter is any state that influences the\n"],"type":"node"},{"attributes":{},"tag":"String","children":["training and is not a parameter of the model.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Hyperparameters can be scheduled using the [`Scheduler`](#)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["callback.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"abstract","children":[{"attributes":{},"tag":"abstract","children":["abstract"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"type","children":["type"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"curly","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.HyperParameter"},"tag":"reference","children":["HyperParameter"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["T"],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" sethyperparameter!(learner, H, value) -> learner\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Sets hyperparameter `H` to `value` on `learner`, returning\n"],"type":"node"},{"attributes":{},"tag":"String","children":["the modified learner.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.sethyperparameter!"},"tag":"reference","children":["sethyperparameter!"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" stateaccess(::Type{HyperParameter})\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Defines what `Learner` state is accessed when calling\n"],"type":"node"},{"attributes":{},"tag":"String","children":["`sethyperparameter!` and `gethyperparameter`. This is needed\n"],"type":"node"},{"attributes":{},"tag":"String","children":["so that [`Scheduler`](#) can access the state.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.stateaccess"},"tag":"reference","children":["stateaccess"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"curly","children":[{"attributes":{},"tag":"Identifier","children":["Type"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.HyperParameter"},"tag":"reference","children":["HyperParameter"],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"p","children":["Implementations"],"type":"node"}],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" abstract type LearningRate <: HyperParameter\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Hyperparameter for the optimizer's learning rate.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["See [`Scheduler`](#) and [hyperparameter scheduling](./docs/tutorials/hyperparameters.md).\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"abstract","children":[{"attributes":{},"tag":"abstract","children":["abstract"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"type","children":["type"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.LearningRate"},"tag":"reference","children":["LearningRate"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"curly","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.HyperParameter"},"tag":"reference","children":["HyperParameter"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Float64"],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.stateaccess"},"tag":"reference","children":["stateaccess"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"curly","children":[{"attributes":{},"tag":"Identifier","children":["Type"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.LearningRate"},"tag":"reference","children":["LearningRate"],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["optimizer"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Write"},"tag":"reference","children":["Write"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.sethyperparameter!"},"tag":"reference","children":["sethyperparameter!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"curly","children":[{"attributes":{},"tag":"Identifier","children":["Type"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.LearningRate"},"tag":"reference","children":["LearningRate"],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["value"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["optimizer"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.setlearningrate!"},"tag":"reference","children":["setlearningrate!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["optimizer"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["value"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.setlearningrate!"},"tag":"reference","children":["setlearningrate!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["optimizer"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Flux"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["Optimise"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["AbstractOptimiser"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["value"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["optimizer"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["eta"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["value"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["optimizer"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.setlearningrate!"},"tag":"reference","children":["setlearningrate!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["optimizer"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["value"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["set"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["optimizer"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["eta"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["value"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file +{"attributes":{"backlinks":[],"path":"/home/runner/.julia/packages/FluxTraining/imTF4/src/callbacks/hyperparameters.jl","package_id":"FluxTraining@dev","title":"FluxTraining/callbacks/hyperparameters.jl","module_id":"FluxTraining"},"tag":"sourcefile","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"p","children":["Hyperparameter interface"],"type":"node"}],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" HyperParameter{T}\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["A hyperparameter is any state that influences the\n"],"type":"node"},{"attributes":{},"tag":"String","children":["training and is not a parameter of the model.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Hyperparameters can be scheduled using the [`Scheduler`](#)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["callback.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"abstract","children":[{"attributes":{},"tag":"abstract","children":["abstract"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"type","children":["type"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"curly","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.HyperParameter"},"tag":"reference","children":["HyperParameter"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["T"],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" sethyperparameter!(learner, H, value) -> learner\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Sets hyperparameter `H` to `value` on `learner`, returning\n"],"type":"node"},{"attributes":{},"tag":"String","children":["the modified learner.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.sethyperparameter!"},"tag":"reference","children":["sethyperparameter!"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" stateaccess(::Type{HyperParameter})\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Defines what `Learner` state is accessed when calling\n"],"type":"node"},{"attributes":{},"tag":"String","children":["`sethyperparameter!` and `gethyperparameter`. This is needed\n"],"type":"node"},{"attributes":{},"tag":"String","children":["so that [`Scheduler`](#) can access the state.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.stateaccess"},"tag":"reference","children":["stateaccess"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"curly","children":[{"attributes":{},"tag":"Identifier","children":["Type"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.HyperParameter"},"tag":"reference","children":["HyperParameter"],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"p","children":["Implementations"],"type":"node"}],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" abstract type LearningRate <: HyperParameter\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Hyperparameter for the optimizer's learning rate.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["See [`Scheduler`](#) and [hyperparameter scheduling](./docs/tutorials/hyperparameters.md).\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"abstract","children":[{"attributes":{},"tag":"abstract","children":["abstract"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"type","children":["type"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.LearningRate"},"tag":"reference","children":["LearningRate"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"curly","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.HyperParameter"},"tag":"reference","children":["HyperParameter"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Float64"],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.stateaccess"},"tag":"reference","children":["stateaccess"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"curly","children":[{"attributes":{},"tag":"Identifier","children":["Type"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.LearningRate"},"tag":"reference","children":["LearningRate"],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["optimizer"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Write"},"tag":"reference","children":["Write"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.sethyperparameter!"},"tag":"reference","children":["sethyperparameter!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"curly","children":[{"attributes":{},"tag":"Identifier","children":["Type"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.LearningRate"},"tag":"reference","children":["LearningRate"],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["value"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["optimizer"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.setlearningrate!"},"tag":"reference","children":["setlearningrate!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["optimizer"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["value"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.setlearningrate!"},"tag":"reference","children":["setlearningrate!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["optimizer"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Flux"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["Optimise"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["AbstractOptimiser"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["value"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["optimizer"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["eta"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["value"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["optimizer"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.setlearningrate!"},"tag":"reference","children":["setlearningrate!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["optimizer"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["value"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["set"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["optimizer"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["eta"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["value"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file diff --git a/data/FluxTraining@dev/src/callbacks/logging/Loggables.jl.json b/data/FluxTraining@dev/src/callbacks/logging/Loggables.jl.json index bcf447d96..474f91859 100644 --- a/data/FluxTraining@dev/src/callbacks/logging/Loggables.jl.json +++ b/data/FluxTraining@dev/src/callbacks/logging/Loggables.jl.json @@ -1 +1 @@ -{"attributes":{"backlinks":[],"path":"/home/runner/.julia/packages/FluxTraining/xCOPx/src/callbacks/logging/Loggables.jl","package_id":"FluxTraining@dev","title":"FluxTraining/callbacks/logging/Loggables.jl","module_id":"FluxTraining"},"tag":"sourcefile","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" module Loggables\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Defines [`Loggables.Loggable`](#) and its subtypes.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"module","children":[{"attributes":{},"tag":"module","children":["module"],"type":"node"},{"attributes":{},"tag":"true","children":[""],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loggables"},"tag":"reference","children":["Loggables"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" abstract type Loggable\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Abstract type for data that [`LoggerBackend`](#)s can log.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["See `subtypes(FluxTraining.Loggables.Loggable)` and [`LoggerBackend`](#)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"abstract","children":[{"attributes":{},"tag":"abstract","children":["abstract"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"type","children":["type"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loggables.Loggable"},"tag":"reference","children":["Loggable"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loggables.Text"},"tag":"reference","children":["Text"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loggables.Loggable"},"tag":"reference","children":["Loggable"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loggables.Image"},"tag":"reference","children":["Image"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loggables.Loggable"},"tag":"reference","children":["Loggable"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loggables.Audio"},"tag":"reference","children":["Audio"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loggables.Loggable"},"tag":"reference","children":["Loggable"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loggables.Histogram"},"tag":"reference","children":["Histogram"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loggables.Loggable"},"tag":"reference","children":["Loggable"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loggables.Value"},"tag":"reference","children":["Value"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loggables.Loggable"},"tag":"reference","children":["Loggable"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loggables.Graph"},"tag":"reference","children":["Graph"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loggables.Loggable"},"tag":"reference","children":["Loggable"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loggables.File"},"tag":"reference","children":["File"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loggables.Loggable"},"tag":"reference","children":["Loggable"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["file"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"p","children":["module"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file +{"attributes":{"backlinks":[],"path":"/home/runner/.julia/packages/FluxTraining/imTF4/src/callbacks/logging/Loggables.jl","package_id":"FluxTraining@dev","title":"FluxTraining/callbacks/logging/Loggables.jl","module_id":"FluxTraining"},"tag":"sourcefile","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" module Loggables\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Defines [`Loggables.Loggable`](#) and its subtypes.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"module","children":[{"attributes":{},"tag":"module","children":["module"],"type":"node"},{"attributes":{},"tag":"true","children":[""],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loggables"},"tag":"reference","children":["Loggables"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" abstract type Loggable\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Abstract type for data that [`LoggerBackend`](#)s can log.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["See `subtypes(FluxTraining.Loggables.Loggable)` and [`LoggerBackend`](#)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"abstract","children":[{"attributes":{},"tag":"abstract","children":["abstract"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"type","children":["type"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loggables.Loggable"},"tag":"reference","children":["Loggable"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loggables.Text"},"tag":"reference","children":["Text"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loggables.Loggable"},"tag":"reference","children":["Loggable"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loggables.Image"},"tag":"reference","children":["Image"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loggables.Loggable"},"tag":"reference","children":["Loggable"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loggables.Audio"},"tag":"reference","children":["Audio"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loggables.Loggable"},"tag":"reference","children":["Loggable"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loggables.Histogram"},"tag":"reference","children":["Histogram"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loggables.Loggable"},"tag":"reference","children":["Loggable"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loggables.Value"},"tag":"reference","children":["Value"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loggables.Loggable"},"tag":"reference","children":["Loggable"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loggables.Graph"},"tag":"reference","children":["Graph"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loggables.Loggable"},"tag":"reference","children":["Loggable"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loggables.File"},"tag":"reference","children":["File"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loggables.Loggable"},"tag":"reference","children":["Loggable"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["file"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"p","children":["module"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file diff --git a/data/FluxTraining@dev/src/callbacks/logging/checkpointer.jl.json b/data/FluxTraining@dev/src/callbacks/logging/checkpointer.jl.json index 9574d14d5..00730d183 100644 --- a/data/FluxTraining@dev/src/callbacks/logging/checkpointer.jl.json +++ b/data/FluxTraining@dev/src/callbacks/logging/checkpointer.jl.json @@ -1 +1 @@ -{"attributes":{"backlinks":[],"path":"/home/runner/.julia/packages/FluxTraining/xCOPx/src/callbacks/logging/checkpointer.jl","package_id":"FluxTraining@dev","title":"FluxTraining/callbacks/logging/checkpointer.jl","module_id":"FluxTraining"},"tag":"sourcefile","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" Checkpointer(folder)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Saves `learner.model` to `folder` after every [`AbstractTrainingPhase`](#).\n"],"type":"node"},{"attributes":{},"tag":"String","children":["If `keep_top_k` is provided, only the best k models (by smallest training loss) and the latest model are kept.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Use `FluxTraining.`[`loadmodel`](#) to load a model.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Checkpointer"},"tag":"reference","children":["Checkpointer"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Callback"},"tag":"reference","children":["Callback"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["folder"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["keep_top_k"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"curly","children":[{"attributes":{},"tag":"Identifier","children":["Union"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Int"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Nothing"],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["top_k"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"curly","children":[{"attributes":{},"tag":"Identifier","children":["PriorityQueue"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["AbstractString"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Real"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Checkpointer"},"tag":"reference","children":["Checkpointer"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["folder"],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["keep_top_k"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"curly","children":[{"attributes":{},"tag":"Identifier","children":["Union"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Int"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Nothing"],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Identifier","children":["nothing"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["mkpath"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["folder"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Comment","children":["# We want to pop the worst checkpoints, i.e. with highest loss."],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Comment","children":["# Therefore, we must reverse Julia's PriorityQueue ordering, which defaults to lowest first."],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["new"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["folder"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["keep_top_k"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"curly","children":[{"attributes":{},"tag":"Identifier","children":["PriorityQueue"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["String"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Float64"],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Base"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["Order"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["Reverse"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.stateaccess"},"tag":"reference","children":["stateaccess"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Checkpointer"},"tag":"reference","children":["Checkpointer"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Read"},"tag":"reference","children":["Read"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["metricsepoch"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Read"},"tag":"reference","children":["Read"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Read"},"tag":"reference","children":["Read"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.on"},"tag":"reference","children":["on"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.EpochEnd"},"tag":"reference","children":["EpochEnd"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.AbstractTrainingPhase"},"tag":"reference","children":["AbstractTrainingPhase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["checkpointer"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Checkpointer"},"tag":"reference","children":["Checkpointer"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["loss"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["last"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["metricsepoch"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loss"},"tag":"reference","children":["Loss"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Integer","children":["2"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["epoch"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["epochs"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["filename"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["checkpoint_epoch_"],"type":"node"},{"attributes":{},"tag":"$","children":["$"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["lpad"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["string"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["epoch"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["3"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Char","children":["'0'"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"},{"attributes":{},"tag":"String","children":["_loss_"],"type":"node"},{"attributes":{},"tag":"$","children":["$"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["loss"],"type":"node"},{"attributes":{},"tag":"String","children":[".bson"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.savemodel"},"tag":"reference","children":["savemodel"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["joinpath"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["checkpointer"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["folder"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["filename"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"!","children":["!"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["isnothing"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["checkpointer"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["keep_top_k"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.process_top_k_checkpoints"},"tag":"reference","children":["process_top_k_checkpoints"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["checkpointer"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["filename"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["loss"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Makes sure only the best k and the latest checkpoints are kept on disk."],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.process_top_k_checkpoints"},"tag":"reference","children":["process_top_k_checkpoints"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["checkpointer"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Checkpointer"},"tag":"reference","children":["Checkpointer"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["new_checkpoint"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["String"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["new_loss"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Real"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Comment","children":["# Note that priority queue may have k+1 elements, also tracking the most recent checkpoint."],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["assert"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["length"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["checkpointer"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["top_k"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<=","children":["<="],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["checkpointer"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["keep_top_k"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"+","children":["+"],"type":"node"},{"attributes":{},"tag":"Integer","children":["1"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["length"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["checkpointer"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["top_k"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"==","children":["=="],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["checkpointer"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["keep_top_k"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"+","children":["+"],"type":"node"},{"attributes":{},"tag":"Integer","children":["1"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Comment","children":["# if most recent checkpoint was worst, remove it"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["most_recent_checkpoint"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["dequeue!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["checkpointer"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["top_k"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["rm"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["joinpath"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["checkpointer"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["folder"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["most_recent_checkpoint"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["force"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"true","children":["true"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Comment","children":["# force=true so that an error doesn't cancel the training"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["enqueue!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["checkpointer"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["top_k"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["new_checkpoint"],"type":"node"},{"attributes":{},"tag":"=>","children":["=>"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["new_loss"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"&&","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["length"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["checkpointer"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["top_k"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":">","children":[">"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["checkpointer"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["keep_top_k"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Comment","children":["# We try to shorten the queue..."],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"&&","children":["&&"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["peek"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["checkpointer"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["top_k"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Integer","children":["1"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"!=","children":["!="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["new_checkpoint"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Comment","children":["# ...but don't remove new checkpoint even if it's the worst,"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Comment","children":["# potentially creating (k+1) elements."],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["worst_checkpoint_that_is_not_new"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["dequeue!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["checkpointer"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["top_k"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["rm"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["joinpath"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["checkpointer"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["folder"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["worst_checkpoint_that_is_not_new"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["force"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"true","children":["true"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Comment","children":["# force=true so that an error doesn't cancel the training"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"p","children":["TODO: replace with JLD2?"],"type":"node"}],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.savemodel"},"tag":"reference","children":["savemodel"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["path"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["save"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["path"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["cpu"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" loadmodel(path)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Loads a model that was saved to `path` using `FluxTraining.`[`savemodel`](#).\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.loadmodel"},"tag":"reference","children":["loadmodel"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["path"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["load"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["path"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file +{"attributes":{"backlinks":[],"path":"/home/runner/.julia/packages/FluxTraining/imTF4/src/callbacks/logging/checkpointer.jl","package_id":"FluxTraining@dev","title":"FluxTraining/callbacks/logging/checkpointer.jl","module_id":"FluxTraining"},"tag":"sourcefile","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" Checkpointer(folder)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Saves `learner.model` to `folder` after every [`AbstractTrainingPhase`](#).\n"],"type":"node"},{"attributes":{},"tag":"String","children":["If `keep_top_k` is provided, only the best k models (by smallest training loss) and the latest model are kept.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Use `FluxTraining.`[`loadmodel`](#) to load a model.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Checkpointer"},"tag":"reference","children":["Checkpointer"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Callback"},"tag":"reference","children":["Callback"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["folder"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["keep_top_k"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"curly","children":[{"attributes":{},"tag":"Identifier","children":["Union"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Int"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Nothing"],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["top_k"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"curly","children":[{"attributes":{},"tag":"Identifier","children":["PriorityQueue"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["AbstractString"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Real"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Checkpointer"},"tag":"reference","children":["Checkpointer"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["folder"],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["keep_top_k"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"curly","children":[{"attributes":{},"tag":"Identifier","children":["Union"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Int"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Nothing"],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Identifier","children":["nothing"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["mkpath"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["folder"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Comment","children":["# We want to pop the worst checkpoints, i.e. with highest loss."],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Comment","children":["# Therefore, we must reverse Julia's PriorityQueue ordering, which defaults to lowest first."],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["new"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["folder"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["keep_top_k"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"curly","children":[{"attributes":{},"tag":"Identifier","children":["PriorityQueue"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["String"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Float64"],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Base"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["Order"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["Reverse"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.stateaccess"},"tag":"reference","children":["stateaccess"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Checkpointer"},"tag":"reference","children":["Checkpointer"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Read"},"tag":"reference","children":["Read"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["metricsepoch"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Read"},"tag":"reference","children":["Read"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Read"},"tag":"reference","children":["Read"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.on"},"tag":"reference","children":["on"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.EpochEnd"},"tag":"reference","children":["EpochEnd"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.AbstractTrainingPhase"},"tag":"reference","children":["AbstractTrainingPhase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["checkpointer"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Checkpointer"},"tag":"reference","children":["Checkpointer"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["loss"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["last"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["metricsepoch"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loss"},"tag":"reference","children":["Loss"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Integer","children":["2"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["epoch"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["epochs"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["filename"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["checkpoint_epoch_"],"type":"node"},{"attributes":{},"tag":"$","children":["$"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["lpad"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["string"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["epoch"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["3"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Char","children":["'0'"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"},{"attributes":{},"tag":"String","children":["_loss_"],"type":"node"},{"attributes":{},"tag":"$","children":["$"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["loss"],"type":"node"},{"attributes":{},"tag":"String","children":[".bson"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.savemodel"},"tag":"reference","children":["savemodel"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["joinpath"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["checkpointer"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["folder"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["filename"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"!","children":["!"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["isnothing"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["checkpointer"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["keep_top_k"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.process_top_k_checkpoints"},"tag":"reference","children":["process_top_k_checkpoints"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["checkpointer"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["filename"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["loss"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Makes sure only the best k and the latest checkpoints are kept on disk."],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.process_top_k_checkpoints"},"tag":"reference","children":["process_top_k_checkpoints"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["checkpointer"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Checkpointer"},"tag":"reference","children":["Checkpointer"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["new_checkpoint"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["String"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["new_loss"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Real"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Comment","children":["# Note that priority queue may have k+1 elements, also tracking the most recent checkpoint."],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["assert"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["length"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["checkpointer"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["top_k"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<=","children":["<="],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["checkpointer"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["keep_top_k"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"+","children":["+"],"type":"node"},{"attributes":{},"tag":"Integer","children":["1"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["length"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["checkpointer"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["top_k"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"==","children":["=="],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["checkpointer"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["keep_top_k"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"+","children":["+"],"type":"node"},{"attributes":{},"tag":"Integer","children":["1"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Comment","children":["# if most recent checkpoint was worst, remove it"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["most_recent_checkpoint"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["dequeue!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["checkpointer"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["top_k"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["rm"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["joinpath"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["checkpointer"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["folder"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["most_recent_checkpoint"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["force"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"true","children":["true"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Comment","children":["# force=true so that an error doesn't cancel the training"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["enqueue!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["checkpointer"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["top_k"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["new_checkpoint"],"type":"node"},{"attributes":{},"tag":"=>","children":["=>"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["new_loss"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"&&","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["length"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["checkpointer"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["top_k"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":">","children":[">"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["checkpointer"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["keep_top_k"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Comment","children":["# We try to shorten the queue..."],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"&&","children":["&&"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["peek"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["checkpointer"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["top_k"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Integer","children":["1"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"!=","children":["!="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["new_checkpoint"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Comment","children":["# ...but don't remove new checkpoint even if it's the worst,"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Comment","children":["# potentially creating (k+1) elements."],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["worst_checkpoint_that_is_not_new"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["dequeue!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["checkpointer"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["top_k"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["rm"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["joinpath"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["checkpointer"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["folder"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["worst_checkpoint_that_is_not_new"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["force"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"true","children":["true"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Comment","children":["# force=true so that an error doesn't cancel the training"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"p","children":["TODO: replace with JLD2?"],"type":"node"}],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.savemodel"},"tag":"reference","children":["savemodel"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["path"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["save"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["path"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["cpu"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" loadmodel(path)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Loads a model that was saved to `path` using `FluxTraining.`[`savemodel`](#).\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.loadmodel"},"tag":"reference","children":["loadmodel"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["path"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["load"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["path"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file diff --git a/data/FluxTraining@dev/src/callbacks/logging/logger.jl.json b/data/FluxTraining@dev/src/callbacks/logging/logger.jl.json index c9706b985..0fb2c0eab 100644 --- a/data/FluxTraining@dev/src/callbacks/logging/logger.jl.json +++ b/data/FluxTraining@dev/src/callbacks/logging/logger.jl.json @@ -1 +1 @@ -{"attributes":{"backlinks":[],"path":"/home/runner/.julia/packages/FluxTraining/xCOPx/src/callbacks/logging/logger.jl","package_id":"FluxTraining@dev","title":"FluxTraining/callbacks/logging/logger.jl","module_id":"FluxTraining"},"tag":"sourcefile","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"import","children":[{"attributes":{},"tag":"import","children":["import"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loggables"},"tag":"reference","children":["Loggables"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" abstract type LoggerBackend\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Backend for logging callbacks like.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["To add support for logging [`Loggables.Loggable`](#) `L` to backend `B`, implement\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["[`log_to`](#)`(backend::B, loggable::L, names, i)`\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["See also [`LogMetrics`](#), [`LogHyperParams`](#), [`log_to`](#)\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"abstract","children":[{"attributes":{},"tag":"abstract","children":["abstract"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"type","children":["type"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.LoggerBackend"},"tag":"reference","children":["LoggerBackend"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" log_to(backend, loggable, group, i)\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" log_to(backends, loggable, group, i)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Log `loggable` to `backend` with `group` to index `i`.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- `loggable` is any [`Loggables.Loggable`](#)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- `group` can be a `String` or a tuple of `String`s implying\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" some grouping which can be used by a supporting backend.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- `i` is a step counter and unique for every group.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.log_to"},"tag":"reference","children":["log_to"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["backends"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Tuple"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["loggable"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["name"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["i"],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["group"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"for","children":[{"attributes":{},"tag":"for","children":["for"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["backend"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"in","children":["in"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["backends"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.log_to"},"tag":"reference","children":["log_to"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["backend"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["loggable"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["name"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["i"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["group"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["group"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" LogTraces(backends...) <: Callback\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Callback that logs step traces to one or more [`LoggerBackend`](#)s.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["See also [`LoggerBackend`](#), [`Loggables.Loggable`](#), [`log_to`](#),\n"],"type":"node"},{"attributes":{},"tag":"String","children":["[`TensorBoardBackend`](#)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Example:\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["```julia\n"],"type":"node"},{"attributes":{},"tag":"String","children":["logcb = LogTraces(TensorBoardBackend(\"tblogs\"))\n"],"type":"node"},{"attributes":{},"tag":"String","children":["tracer = Traces((trace = learner -> learner.step.loss^2,), TrainingPhase)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Learner(model, lossfn; callbacks=[tracer, logcb])\n"],"type":"node"},{"attributes":{},"tag":"String","children":["```\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.LogTraces"},"tag":"reference","children":["LogTraces"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Callback"},"tag":"reference","children":["Callback"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["backends"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Tuple"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.LogTraces"},"tag":"reference","children":["LogTraces"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"...","children":[{"attributes":{},"tag":"Identifier","children":["backends"],"type":"node"},{"attributes":{},"tag":"...","children":["..."],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["new"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["backends"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.stateaccess"},"tag":"reference","children":["stateaccess"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.LogTraces"},"tag":"reference","children":["LogTraces"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Read"},"tag":"reference","children":["Read"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["tracehistory"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Read"},"tag":"reference","children":["Read"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.on"},"tag":"reference","children":["on"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.StepEnd"},"tag":"reference","children":["StepEnd"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["logger"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.LogTraces"},"tag":"reference","children":["LogTraces"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["traces"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["tracehistory"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"for","children":[{"attributes":{},"tag":"for","children":["for"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["trace"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"in","children":["in"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["keys"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["traces"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["val"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["last"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["last"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["traces"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["trace"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.log_to"},"tag":"reference","children":["log_to"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["logger"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["backends"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loggables"},"tag":"reference","children":["Loggables"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loggables.Value"},"tag":"reference","children":["Value"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["val"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["string"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["trace"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["steps"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["group"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Step"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["string"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["typeof"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Traces"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" LogMetrics(backends...) <: Callback\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Callback that logs step and epoch metrics to one or more [`LoggerBackend`](#)s.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["See also [`LoggerBackend`](#), [`Loggables.Loggable`](#), [`log_to`](#),\n"],"type":"node"},{"attributes":{},"tag":"String","children":["[`TensorBoardBackend`](#)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Example:\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["```julia\n"],"type":"node"},{"attributes":{},"tag":"String","children":["logcb = LogMetrics(TensorBoardBackend(\"tblogs\"))\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Learner(model, lossfn; callbacks=[Metrics(accuracy), logcb])\n"],"type":"node"},{"attributes":{},"tag":"String","children":["```\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.LogMetrics"},"tag":"reference","children":["LogMetrics"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Callback"},"tag":"reference","children":["Callback"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["backends"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Tuple"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.LogMetrics"},"tag":"reference","children":["LogMetrics"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"...","children":[{"attributes":{},"tag":"Identifier","children":["backends"],"type":"node"},{"attributes":{},"tag":"...","children":["..."],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["new"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["backends"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.stateaccess"},"tag":"reference","children":["stateaccess"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.LogMetrics"},"tag":"reference","children":["LogMetrics"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Read"},"tag":"reference","children":["Read"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["metricsstep"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Read"},"tag":"reference","children":["Read"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["metricsepoch"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Read"},"tag":"reference","children":["Read"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.on"},"tag":"reference","children":["on"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.StepEnd"},"tag":"reference","children":["StepEnd"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["logger"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.LogMetrics"},"tag":"reference","children":["LogMetrics"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["metricsstep"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["metricsstep"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"for","children":[{"attributes":{},"tag":"for","children":["for"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"in","children":["in"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["keys"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["metricsstep"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["val"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["last"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["last"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["metricsstep"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.log_to"},"tag":"reference","children":["log_to"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["logger"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["backends"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loggables"},"tag":"reference","children":["Loggables"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loggables.Value"},"tag":"reference","children":["Value"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["val"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["string"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["steps"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["group"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Step"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["string"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["typeof"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Metrics"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.on"},"tag":"reference","children":["on"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.EpochEnd"},"tag":"reference","children":["EpochEnd"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["logger"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.LogMetrics"},"tag":"reference","children":["LogMetrics"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["metricsepoch"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["metricsepoch"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"for","children":[{"attributes":{},"tag":"for","children":["for"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"in","children":["in"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["keys"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["metricsepoch"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"Identifier","children":["_"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["val"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["last"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["metricsepoch"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.log_to"},"tag":"reference","children":["log_to"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["logger"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["backends"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loggables"},"tag":"reference","children":["Loggables"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loggables.Value"},"tag":"reference","children":["Value"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["val"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["string"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["epochs"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["group"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Epoch"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["string"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["typeof"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Metrics"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" LogHyperParams(backends...) <: Callback\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Callback that logs hyperparameters to one or more [`LoggerBackend`](#)s.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["See also [`LoggerBackend`](#), [`Loggables.Loggable`](#), [`log_to`](#),\n"],"type":"node"},{"attributes":{},"tag":"String","children":["[`TensorBoardBackend`](#)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["## Example\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["```julia\n"],"type":"node"},{"attributes":{},"tag":"String","children":["logcb = LogHyperParams(TensorBoardBackend(\"tblogs\"))\n"],"type":"node"},{"attributes":{},"tag":"String","children":["schedule = ...\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Learner(model, lossfn; callbacks=[Scheduler(LearningRate => schedule), logcb])\n"],"type":"node"},{"attributes":{},"tag":"String","children":["```\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.LogHyperParams"},"tag":"reference","children":["LogHyperParams"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Callback"},"tag":"reference","children":["Callback"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["backends"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Tuple"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.LogHyperParams"},"tag":"reference","children":["LogHyperParams"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"...","children":[{"attributes":{},"tag":"Identifier","children":["backends"],"type":"node"},{"attributes":{},"tag":"...","children":["..."],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["new"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["backends"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.stateaccess"},"tag":"reference","children":["stateaccess"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.LogHyperParams"},"tag":"reference","children":["LogHyperParams"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Read"},"tag":"reference","children":["Read"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["hyperparams"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Read"},"tag":"reference","children":["Read"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.on"},"tag":"reference","children":["on"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.StepEnd"},"tag":"reference","children":["StepEnd"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["logger"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.LogHyperParams"},"tag":"reference","children":["LogHyperParams"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["hyperparams"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["hyperparams"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"for","children":[{"attributes":{},"tag":"for","children":["for"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["hparam"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"in","children":["in"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["keys"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["hyperparams"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["val"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["last"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["last"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["hyperparams"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["hparam"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.log_to"},"tag":"reference","children":["log_to"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["logger"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["backends"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loggables"},"tag":"reference","children":["Loggables"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loggables.Value"},"tag":"reference","children":["Value"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["val"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["string"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["hparam"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["steps"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["group"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Step"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["HParams"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"p","children":["TODO: add support for logging histograms of layer activations and gradients"],"type":"node"}],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" LogHistograms(backends...[; freq = 100]) <: Callback\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Callback that logs histograms of model weights to [`LoggerBackend`](#)s\n"],"type":"node"},{"attributes":{},"tag":"String","children":["`backends` every `freq` steps.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["If histograms should be logged every step, pass `freq = nothing`\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.LogHistograms"},"tag":"reference","children":["LogHistograms"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Callback"},"tag":"reference","children":["Callback"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["backends"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Tuple"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.LogHistograms"},"tag":"reference","children":["LogHistograms"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"...","children":[{"attributes":{},"tag":"Identifier","children":["backends"],"type":"node"},{"attributes":{},"tag":"...","children":["..."],"type":"node"}],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["freq"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["100"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["isnothing"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["freq"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["new"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["backends"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"else","children":["else"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.throttle"},"tag":"reference","children":["throttle"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["new"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["backends"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.StepEnd"},"tag":"reference","children":["StepEnd"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["freq"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["freq"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.stateaccess"},"tag":"reference","children":["stateaccess"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.LogHistograms"},"tag":"reference","children":["LogHistograms"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Read"},"tag":"reference","children":["Read"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Read"},"tag":"reference","children":["Read"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.on"},"tag":"reference","children":["on"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.StepEnd"},"tag":"reference","children":["StepEnd"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.AbstractTrainingPhase"},"tag":"reference","children":["AbstractTrainingPhase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["logger"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.LogHistograms"},"tag":"reference","children":["LogHistograms"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.log_parameters"},"tag":"reference","children":["log_parameters"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["logger"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["backends"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Model"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["steps"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["group"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Step"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Histograms"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Weights"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.log_parameters"},"tag":"reference","children":["log_parameters"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["backends"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["x"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["name"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["epochs"],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["group"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["params"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Flux"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["trainable"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["x"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"&&","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["isempty"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["params"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"&&","children":["&&"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["x"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"isa","children":["isa"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["AbstractArray"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.log_to"},"tag":"reference","children":["log_to"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["backends"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loggables"},"tag":"reference","children":["Loggables"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loggables.Histogram"},"tag":"reference","children":["Histogram"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["vec"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["x"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["name"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["epochs"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["group"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["group"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"else","children":["else"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"for","children":[{"attributes":{},"tag":"for","children":["for"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["pname"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["pval"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"in","children":["in"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["pairs"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["params"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.log_parameters"},"tag":"reference","children":["log_parameters"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["backends"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["pval"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"$","children":["$"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["name"],"type":"node"},{"attributes":{},"tag":"String","children":["."],"type":"node"},{"attributes":{},"tag":"$","children":["$"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["pname"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["epochs"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["group"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["group"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" LogVisualization(visfn, backends...[; freq = 100])\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Logs images created by `visfn(learner.step)` to `backends` every `freq` steps.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.LogVisualization"},"tag":"reference","children":["LogVisualization"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Callback"},"tag":"reference","children":["Callback"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["visfn"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["backends"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Tuple"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.LogVisualization"},"tag":"reference","children":["LogVisualization"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["visfn"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"...","children":[{"attributes":{},"tag":"Identifier","children":["backends"],"type":"node"},{"attributes":{},"tag":"...","children":["..."],"type":"node"}],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["freq"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["100"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["new"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["visfn"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["backends"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["isnothing"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["freq"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"else","children":["else"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.throttle"},"tag":"reference","children":["throttle"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.StepEnd"},"tag":"reference","children":["StepEnd"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["freq"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["freq"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.stateaccess"},"tag":"reference","children":["stateaccess"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.LogVisualization"},"tag":"reference","children":["LogVisualization"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["step"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Read"},"tag":"reference","children":["Read"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Read"},"tag":"reference","children":["Read"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.on"},"tag":"reference","children":["on"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.StepEnd"},"tag":"reference","children":["StepEnd"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.AbstractTrainingPhase"},"tag":"reference","children":["AbstractTrainingPhase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["logger"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.LogVisualization"},"tag":"reference","children":["LogVisualization"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["image"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["logger"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["visfn"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["step"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.log_to"},"tag":"reference","children":["log_to"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["logger"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["backends"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loggables"},"tag":"reference","children":["Loggables"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loggables.Image"},"tag":"reference","children":["Image"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["image"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Visualization"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["steps"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["group"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Step"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file +{"attributes":{"backlinks":[],"path":"/home/runner/.julia/packages/FluxTraining/imTF4/src/callbacks/logging/logger.jl","package_id":"FluxTraining@dev","title":"FluxTraining/callbacks/logging/logger.jl","module_id":"FluxTraining"},"tag":"sourcefile","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"import","children":[{"attributes":{},"tag":"import","children":["import"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loggables"},"tag":"reference","children":["Loggables"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" abstract type LoggerBackend\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Backend for logging callbacks like.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["To add support for logging [`Loggables.Loggable`](#) `L` to backend `B`, implement\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["[`log_to`](#)`(backend::B, loggable::L, names, i)`\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["See also [`LogMetrics`](#), [`LogHyperParams`](#), [`log_to`](#)\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"abstract","children":[{"attributes":{},"tag":"abstract","children":["abstract"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"type","children":["type"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.LoggerBackend"},"tag":"reference","children":["LoggerBackend"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" log_to(backend, loggable, group, i)\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" log_to(backends, loggable, group, i)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Log `loggable` to `backend` with `group` to index `i`.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- `loggable` is any [`Loggables.Loggable`](#)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- `group` can be a `String` or a tuple of `String`s implying\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" some grouping which can be used by a supporting backend.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- `i` is a step counter and unique for every group.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.log_to"},"tag":"reference","children":["log_to"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["backends"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Tuple"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["loggable"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["name"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["i"],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["group"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"for","children":[{"attributes":{},"tag":"for","children":["for"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["backend"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"in","children":["in"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["backends"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.log_to"},"tag":"reference","children":["log_to"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["backend"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["loggable"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["name"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["i"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["group"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["group"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" LogTraces(backends...) <: Callback\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Callback that logs step traces to one or more [`LoggerBackend`](#)s.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["See also [`LoggerBackend`](#), [`Loggables.Loggable`](#), [`log_to`](#),\n"],"type":"node"},{"attributes":{},"tag":"String","children":["[`TensorBoardBackend`](#)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Example:\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["```julia\n"],"type":"node"},{"attributes":{},"tag":"String","children":["logcb = LogTraces(TensorBoardBackend(\"tblogs\"))\n"],"type":"node"},{"attributes":{},"tag":"String","children":["tracer = Traces((trace = learner -> learner.step.loss^2,), TrainingPhase)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Learner(model, lossfn; callbacks=[tracer, logcb])\n"],"type":"node"},{"attributes":{},"tag":"String","children":["```\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.LogTraces"},"tag":"reference","children":["LogTraces"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Callback"},"tag":"reference","children":["Callback"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["backends"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Tuple"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.LogTraces"},"tag":"reference","children":["LogTraces"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"...","children":[{"attributes":{},"tag":"Identifier","children":["backends"],"type":"node"},{"attributes":{},"tag":"...","children":["..."],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["new"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["backends"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.stateaccess"},"tag":"reference","children":["stateaccess"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.LogTraces"},"tag":"reference","children":["LogTraces"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Read"},"tag":"reference","children":["Read"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["tracehistory"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Read"},"tag":"reference","children":["Read"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.on"},"tag":"reference","children":["on"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.StepEnd"},"tag":"reference","children":["StepEnd"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["logger"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.LogTraces"},"tag":"reference","children":["LogTraces"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["traces"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["tracehistory"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"for","children":[{"attributes":{},"tag":"for","children":["for"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["trace"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"in","children":["in"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["keys"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["traces"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["val"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["last"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["last"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["traces"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["trace"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.log_to"},"tag":"reference","children":["log_to"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["logger"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["backends"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loggables"},"tag":"reference","children":["Loggables"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loggables.Value"},"tag":"reference","children":["Value"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["val"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["string"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["trace"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["steps"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["group"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Step"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["string"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["typeof"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Traces"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" LogMetrics(backends...) <: Callback\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Callback that logs step and epoch metrics to one or more [`LoggerBackend`](#)s.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["See also [`LoggerBackend`](#), [`Loggables.Loggable`](#), [`log_to`](#),\n"],"type":"node"},{"attributes":{},"tag":"String","children":["[`TensorBoardBackend`](#)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Example:\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["```julia\n"],"type":"node"},{"attributes":{},"tag":"String","children":["logcb = LogMetrics(TensorBoardBackend(\"tblogs\"))\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Learner(model, lossfn; callbacks=[Metrics(accuracy), logcb])\n"],"type":"node"},{"attributes":{},"tag":"String","children":["```\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.LogMetrics"},"tag":"reference","children":["LogMetrics"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Callback"},"tag":"reference","children":["Callback"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["backends"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Tuple"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.LogMetrics"},"tag":"reference","children":["LogMetrics"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"...","children":[{"attributes":{},"tag":"Identifier","children":["backends"],"type":"node"},{"attributes":{},"tag":"...","children":["..."],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["new"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["backends"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.stateaccess"},"tag":"reference","children":["stateaccess"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.LogMetrics"},"tag":"reference","children":["LogMetrics"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Read"},"tag":"reference","children":["Read"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["metricsstep"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Read"},"tag":"reference","children":["Read"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["metricsepoch"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Read"},"tag":"reference","children":["Read"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.on"},"tag":"reference","children":["on"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.StepEnd"},"tag":"reference","children":["StepEnd"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["logger"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.LogMetrics"},"tag":"reference","children":["LogMetrics"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["metricsstep"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["metricsstep"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"for","children":[{"attributes":{},"tag":"for","children":["for"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"in","children":["in"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["keys"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["metricsstep"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["val"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["last"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["last"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["metricsstep"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.log_to"},"tag":"reference","children":["log_to"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["logger"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["backends"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loggables"},"tag":"reference","children":["Loggables"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loggables.Value"},"tag":"reference","children":["Value"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["val"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["string"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["steps"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["group"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Step"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["string"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["typeof"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Metrics"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.on"},"tag":"reference","children":["on"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.EpochEnd"},"tag":"reference","children":["EpochEnd"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["logger"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.LogMetrics"},"tag":"reference","children":["LogMetrics"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["metricsepoch"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["metricsepoch"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"for","children":[{"attributes":{},"tag":"for","children":["for"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"in","children":["in"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["keys"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["metricsepoch"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"Identifier","children":["_"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["val"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["last"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["metricsepoch"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.log_to"},"tag":"reference","children":["log_to"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["logger"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["backends"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loggables"},"tag":"reference","children":["Loggables"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loggables.Value"},"tag":"reference","children":["Value"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["val"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["string"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["epochs"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["group"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Epoch"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["string"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["typeof"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Metrics"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" LogHyperParams(backends...) <: Callback\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Callback that logs hyperparameters to one or more [`LoggerBackend`](#)s.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["See also [`LoggerBackend`](#), [`Loggables.Loggable`](#), [`log_to`](#),\n"],"type":"node"},{"attributes":{},"tag":"String","children":["[`TensorBoardBackend`](#)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["## Example\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["```julia\n"],"type":"node"},{"attributes":{},"tag":"String","children":["logcb = LogHyperParams(TensorBoardBackend(\"tblogs\"))\n"],"type":"node"},{"attributes":{},"tag":"String","children":["schedule = ...\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Learner(model, lossfn; callbacks=[Scheduler(LearningRate => schedule), logcb])\n"],"type":"node"},{"attributes":{},"tag":"String","children":["```\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.LogHyperParams"},"tag":"reference","children":["LogHyperParams"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Callback"},"tag":"reference","children":["Callback"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["backends"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Tuple"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.LogHyperParams"},"tag":"reference","children":["LogHyperParams"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"...","children":[{"attributes":{},"tag":"Identifier","children":["backends"],"type":"node"},{"attributes":{},"tag":"...","children":["..."],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["new"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["backends"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.stateaccess"},"tag":"reference","children":["stateaccess"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.LogHyperParams"},"tag":"reference","children":["LogHyperParams"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Read"},"tag":"reference","children":["Read"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["hyperparams"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Read"},"tag":"reference","children":["Read"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.on"},"tag":"reference","children":["on"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.StepEnd"},"tag":"reference","children":["StepEnd"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["logger"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.LogHyperParams"},"tag":"reference","children":["LogHyperParams"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["hyperparams"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["hyperparams"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"for","children":[{"attributes":{},"tag":"for","children":["for"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["hparam"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"in","children":["in"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["keys"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["hyperparams"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["val"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["last"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["last"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["hyperparams"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["hparam"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.log_to"},"tag":"reference","children":["log_to"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["logger"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["backends"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loggables"},"tag":"reference","children":["Loggables"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loggables.Value"},"tag":"reference","children":["Value"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["val"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["string"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["hparam"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["steps"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["group"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Step"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["HParams"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"p","children":["TODO: add support for logging histograms of layer activations and gradients"],"type":"node"}],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" LogHistograms(backends...[; freq = 100]) <: Callback\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Callback that logs histograms of model weights to [`LoggerBackend`](#)s\n"],"type":"node"},{"attributes":{},"tag":"String","children":["`backends` every `freq` steps.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["If histograms should be logged every step, pass `freq = nothing`\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.LogHistograms"},"tag":"reference","children":["LogHistograms"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Callback"},"tag":"reference","children":["Callback"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["backends"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Tuple"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.LogHistograms"},"tag":"reference","children":["LogHistograms"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"...","children":[{"attributes":{},"tag":"Identifier","children":["backends"],"type":"node"},{"attributes":{},"tag":"...","children":["..."],"type":"node"}],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["freq"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["100"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["isnothing"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["freq"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["new"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["backends"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"else","children":["else"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.throttle"},"tag":"reference","children":["throttle"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["new"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["backends"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.StepEnd"},"tag":"reference","children":["StepEnd"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["freq"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["freq"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.stateaccess"},"tag":"reference","children":["stateaccess"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.LogHistograms"},"tag":"reference","children":["LogHistograms"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Read"},"tag":"reference","children":["Read"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Read"},"tag":"reference","children":["Read"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.on"},"tag":"reference","children":["on"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.StepEnd"},"tag":"reference","children":["StepEnd"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.AbstractTrainingPhase"},"tag":"reference","children":["AbstractTrainingPhase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["logger"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.LogHistograms"},"tag":"reference","children":["LogHistograms"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.log_parameters"},"tag":"reference","children":["log_parameters"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["logger"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["backends"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Model"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["steps"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["group"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Step"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Histograms"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Weights"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.log_parameters"},"tag":"reference","children":["log_parameters"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["backends"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["x"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["name"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["epochs"],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["group"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["params"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Flux"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["trainable"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["x"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"&&","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["isempty"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["params"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"&&","children":["&&"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["x"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"isa","children":["isa"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["AbstractArray"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.log_to"},"tag":"reference","children":["log_to"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["backends"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loggables"},"tag":"reference","children":["Loggables"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loggables.Histogram"},"tag":"reference","children":["Histogram"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["vec"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["x"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["name"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["epochs"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["group"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["group"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"else","children":["else"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"for","children":[{"attributes":{},"tag":"for","children":["for"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["pname"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["pval"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"in","children":["in"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["pairs"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["params"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.log_parameters"},"tag":"reference","children":["log_parameters"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["backends"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["pval"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"$","children":["$"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["name"],"type":"node"},{"attributes":{},"tag":"String","children":["."],"type":"node"},{"attributes":{},"tag":"$","children":["$"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["pname"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["epochs"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["group"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["group"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" LogVisualization(visfn, backends...[; freq = 100])\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Logs images created by `visfn(learner.step)` to `backends` every `freq` steps.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.LogVisualization"},"tag":"reference","children":["LogVisualization"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Callback"},"tag":"reference","children":["Callback"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["visfn"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["backends"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Tuple"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.LogVisualization"},"tag":"reference","children":["LogVisualization"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["visfn"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"...","children":[{"attributes":{},"tag":"Identifier","children":["backends"],"type":"node"},{"attributes":{},"tag":"...","children":["..."],"type":"node"}],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["freq"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["100"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["new"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["visfn"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["backends"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["isnothing"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["freq"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"else","children":["else"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.throttle"},"tag":"reference","children":["throttle"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.StepEnd"},"tag":"reference","children":["StepEnd"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["freq"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["freq"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.stateaccess"},"tag":"reference","children":["stateaccess"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.LogVisualization"},"tag":"reference","children":["LogVisualization"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["step"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Read"},"tag":"reference","children":["Read"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Read"},"tag":"reference","children":["Read"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.on"},"tag":"reference","children":["on"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.StepEnd"},"tag":"reference","children":["StepEnd"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.AbstractTrainingPhase"},"tag":"reference","children":["AbstractTrainingPhase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["logger"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.LogVisualization"},"tag":"reference","children":["LogVisualization"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["image"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["logger"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["visfn"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["step"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.log_to"},"tag":"reference","children":["log_to"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["logger"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["backends"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loggables"},"tag":"reference","children":["Loggables"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loggables.Image"},"tag":"reference","children":["Image"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["image"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Visualization"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["steps"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["group"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Step"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file diff --git a/data/FluxTraining@dev/src/callbacks/logging/tensorboard.jl.json b/data/FluxTraining@dev/src/callbacks/logging/tensorboard.jl.json index cf85b04dc..93daf9d6d 100644 --- a/data/FluxTraining@dev/src/callbacks/logging/tensorboard.jl.json +++ b/data/FluxTraining@dev/src/callbacks/logging/tensorboard.jl.json @@ -1 +1 @@ -{"attributes":{"backlinks":[],"path":"/home/runner/.julia/packages/FluxTraining/xCOPx/src/callbacks/logging/tensorboard.jl","package_id":"FluxTraining@dev","title":"FluxTraining/callbacks/logging/tensorboard.jl","module_id":"FluxTraining"},"tag":"sourcefile","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" TensorBoardBackend(logdir[, tb_overwrite];\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" time=time(),\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" purge_step=nothing,\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" step_increment=1,\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" min_level=Logging.Info)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["TensorBoard backend for logging callbacks. Takes the same arguments\n"],"type":"node"},{"attributes":{},"tag":"String","children":["as [`TensorBoardLogger.TBLogger`](https://julialogging.github.io/TensorBoardLogger.jl/dev/).\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.TensorBoardBackend"},"tag":"reference","children":["TensorBoardBackend"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.LoggerBackend"},"tag":"reference","children":["LoggerBackend"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["logger"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["TBLogger"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.TensorBoardBackend"},"tag":"reference","children":["TensorBoardBackend"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["logdir"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["existfn"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["tb_overwrite"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"...","children":[{"attributes":{},"tag":"Identifier","children":["kwargs"],"type":"node"},{"attributes":{},"tag":"...","children":["..."],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["new"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["TBLogger"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["logdir"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["existfn"],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"...","children":[{"attributes":{},"tag":"Identifier","children":["kwargs"],"type":"node"},{"attributes":{},"tag":"...","children":["..."],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Base"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["show"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["io"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["IO"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["backend"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.TensorBoardBackend"},"tag":"reference","children":["TensorBoardBackend"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["print"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["io"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["TensorBoardBackend("],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["backend"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["logger"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["logdir"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":[")"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.log_to"},"tag":"reference","children":["log_to"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["backend"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.TensorBoardBackend"},"tag":"reference","children":["TensorBoardBackend"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["value"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loggables"},"tag":"reference","children":["Loggables"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loggables.Value"},"tag":"reference","children":["Value"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["name"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["i"],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["group"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["name"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["_combinename"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["name"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["group"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["log_value"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["backend"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["logger"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["name"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["value"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["step"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["i"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.log_to"},"tag":"reference","children":["log_to"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["backend"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.TensorBoardBackend"},"tag":"reference","children":["TensorBoardBackend"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["image"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loggables"},"tag":"reference","children":["Loggables"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loggables.Image"},"tag":"reference","children":["Image"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["name"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["i"],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["group"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["name"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["_combinename"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["name"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["group"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["im"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["ImageCore"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["clamp01nan!"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["collect"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["image"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["log_image"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["backend"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["logger"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["name"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["im"],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["step"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["i"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.log_to"},"tag":"reference","children":["log_to"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["backend"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.TensorBoardBackend"},"tag":"reference","children":["TensorBoardBackend"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["text"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loggables"},"tag":"reference","children":["Loggables"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loggables.Text"},"tag":"reference","children":["Text"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["name"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["i"],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["group"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["name"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["_combinename"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["name"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["group"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["log_text"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["backend"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["logger"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["name"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["text"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["step"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["i"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.log_to"},"tag":"reference","children":["log_to"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["backend"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.TensorBoardBackend"},"tag":"reference","children":["TensorBoardBackend"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["hist"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loggables"},"tag":"reference","children":["Loggables"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loggables.Histogram"},"tag":"reference","children":["Histogram"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["name"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["i"],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["group"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["name"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["_combinename"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["name"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["group"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["log_histogram"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["backend"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["logger"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["name"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["hist"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["step"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Identifier","children":["i"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"p","children":["Utilities"],"type":"node"}],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["_combinename"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["name"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["group"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["String"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["_combinename"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["group"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["name"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["_combinename"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["name"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["group"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Tuple"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["_combinename"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"...","children":[{"attributes":{},"tag":"Identifier","children":["group"],"type":"node"},{"attributes":{},"tag":"...","children":["..."],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["name"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["_combinename"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["strings"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Tuple"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["join"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["strings"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Char","children":["'/'"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file +{"attributes":{"backlinks":[],"path":"/home/runner/.julia/packages/FluxTraining/imTF4/src/callbacks/logging/tensorboard.jl","package_id":"FluxTraining@dev","title":"FluxTraining/callbacks/logging/tensorboard.jl","module_id":"FluxTraining"},"tag":"sourcefile","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" TensorBoardBackend(logdir[, tb_overwrite];\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" time=time(),\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" purge_step=nothing,\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" step_increment=1,\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" min_level=Logging.Info)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["TensorBoard backend for logging callbacks. Takes the same arguments\n"],"type":"node"},{"attributes":{},"tag":"String","children":["as [`TensorBoardLogger.TBLogger`](https://julialogging.github.io/TensorBoardLogger.jl/dev/).\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.TensorBoardBackend"},"tag":"reference","children":["TensorBoardBackend"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.LoggerBackend"},"tag":"reference","children":["LoggerBackend"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["logger"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["TBLogger"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.TensorBoardBackend"},"tag":"reference","children":["TensorBoardBackend"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["logdir"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["existfn"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["tb_overwrite"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"...","children":[{"attributes":{},"tag":"Identifier","children":["kwargs"],"type":"node"},{"attributes":{},"tag":"...","children":["..."],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["new"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["TBLogger"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["logdir"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["existfn"],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"...","children":[{"attributes":{},"tag":"Identifier","children":["kwargs"],"type":"node"},{"attributes":{},"tag":"...","children":["..."],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Base"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["show"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["io"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["IO"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["backend"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.TensorBoardBackend"},"tag":"reference","children":["TensorBoardBackend"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["print"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["io"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["TensorBoardBackend("],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["backend"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["logger"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["logdir"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":[")"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.log_to"},"tag":"reference","children":["log_to"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["backend"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.TensorBoardBackend"},"tag":"reference","children":["TensorBoardBackend"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["value"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loggables"},"tag":"reference","children":["Loggables"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loggables.Value"},"tag":"reference","children":["Value"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["name"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["i"],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["group"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["name"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["_combinename"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["name"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["group"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["log_value"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["backend"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["logger"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["name"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["value"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["step"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["i"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.log_to"},"tag":"reference","children":["log_to"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["backend"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.TensorBoardBackend"},"tag":"reference","children":["TensorBoardBackend"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["image"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loggables"},"tag":"reference","children":["Loggables"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loggables.Image"},"tag":"reference","children":["Image"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["name"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["i"],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["group"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["name"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["_combinename"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["name"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["group"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["im"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["ImageCore"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["clamp01nan!"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["collect"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["image"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["log_image"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["backend"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["logger"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["name"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["im"],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["step"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["i"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.log_to"},"tag":"reference","children":["log_to"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["backend"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.TensorBoardBackend"},"tag":"reference","children":["TensorBoardBackend"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["text"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loggables"},"tag":"reference","children":["Loggables"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loggables.Text"},"tag":"reference","children":["Text"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["name"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["i"],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["group"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["name"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["_combinename"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["name"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["group"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["log_text"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["backend"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["logger"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["name"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["text"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["step"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["i"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.log_to"},"tag":"reference","children":["log_to"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["backend"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.TensorBoardBackend"},"tag":"reference","children":["TensorBoardBackend"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["hist"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loggables"},"tag":"reference","children":["Loggables"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loggables.Histogram"},"tag":"reference","children":["Histogram"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["name"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["i"],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["group"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["name"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["_combinename"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["name"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["group"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["log_histogram"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["backend"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["logger"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["name"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["hist"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["step"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Identifier","children":["i"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"p","children":["Utilities"],"type":"node"}],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["_combinename"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["name"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["group"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["String"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["_combinename"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["group"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["name"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["_combinename"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["name"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["group"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Tuple"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["_combinename"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"...","children":[{"attributes":{},"tag":"Identifier","children":["group"],"type":"node"},{"attributes":{},"tag":"...","children":["..."],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["name"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["_combinename"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["strings"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Tuple"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["join"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["strings"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Char","children":["'/'"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file diff --git a/data/FluxTraining@dev/src/callbacks/metrics.jl.json b/data/FluxTraining@dev/src/callbacks/metrics.jl.json index 2945b5b9f..54939f655 100644 --- a/data/FluxTraining@dev/src/callbacks/metrics.jl.json +++ b/data/FluxTraining@dev/src/callbacks/metrics.jl.json @@ -1 +1 @@ -{"attributes":{"backlinks":[],"path":"/home/runner/.julia/packages/FluxTraining/xCOPx/src/callbacks/metrics.jl","package_id":"FluxTraining@dev","title":"FluxTraining/callbacks/metrics.jl","module_id":"FluxTraining"},"tag":"sourcefile","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" Metrics(metrics...) <: Callback\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Callback that tracks metrics during training.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["You can pass any number of `metrics` with every argument being\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- an [`AbstractMetric`](#) like [`Metric`](#); or\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- a function `f(ŷs, ys) -> val`\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["This callback is added by default to every [`Learner`](#) unless you pass in\n"],"type":"node"},{"attributes":{},"tag":"String","children":["`usedefaultcallbacks = false`. A metric tracking `learner.lossfn` [`Loss`](#)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["is included by default.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["The computed metrics can be access in `learner.cbstate.metricsstep` and\n"],"type":"node"},{"attributes":{},"tag":"String","children":["`learner.cbstate.metricsepoch` for steps and epochs, respectively.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["## Examples\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Track [`accuracy`](#):\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["```julia\n"],"type":"node"},{"attributes":{},"tag":"String","children":["cb = Metrics(accuracy)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["```\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Pass in [`Metric`]s:\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["```julia\n"],"type":"node"},{"attributes":{},"tag":"String","children":["cb = Metrics(\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" Metric(Flux.mse, device = gpu),\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" Metric(Flux.mae, device = gpu)\n"],"type":"node"},{"attributes":{},"tag":"String","children":[")\n"],"type":"node"},{"attributes":{},"tag":"String","children":["```\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Metrics"},"tag":"reference","children":["Metrics"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Callback"},"tag":"reference","children":["Callback"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["metrics"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Tuple"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Metrics"},"tag":"reference","children":["Metrics"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"...","children":[{"attributes":{},"tag":"Identifier","children":["metrics"],"type":"node"},{"attributes":{},"tag":"...","children":["..."],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["new"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["Tuple"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"generator","children":[{"attributes":{},"tag":"?","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["m"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"isa","children":["isa"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.AbstractMetric"},"tag":"reference","children":["AbstractMetric"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"?","children":["?"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["m"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Metric"},"tag":"reference","children":["Metric"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["m"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"for","children":["for"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["m"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"in","children":["in"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loss"},"tag":"reference","children":["Loss"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"...","children":[{"attributes":{},"tag":"Identifier","children":["metrics"],"type":"node"},{"attributes":{},"tag":"...","children":["..."],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.runafter"},"tag":"reference","children":["runafter"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Metrics"},"tag":"reference","children":["Metrics"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Recorder"},"tag":"reference","children":["Recorder"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.stateaccess"},"tag":"reference","children":["stateaccess"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Metrics"},"tag":"reference","children":["Metrics"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["metricsstep"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Write"},"tag":"reference","children":["Write"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["metricsepoch"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Write"},"tag":"reference","children":["Write"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Read"},"tag":"reference","children":["Read"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["step"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Read"},"tag":"reference","children":["Read"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Base"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["show"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["io"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["IO"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["metrics"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Metrics"},"tag":"reference","children":["Metrics"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["print"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["io"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Metrics("],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["join"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["string"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["metrics"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["metrics"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":[", "],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":[")"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"p","children":["store metrics in ",{"attributes":{},"tag":"code","children":["cbstate"],"type":"node"}," so other callbacks can access them"],"type":"node"}],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.init!"},"tag":"reference","children":["init!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["metrics"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Metrics"},"tag":"reference","children":["Metrics"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"||","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["length"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["metrics"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["metrics"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"==","children":["=="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["length"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["unique"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.metricname"},"tag":"reference","children":["metricname"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["metrics"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["metrics"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"||","children":["||"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["error"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Multiple metrics have the same name!"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"!","children":["!"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["haskey"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["metricsstep"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["metricsstep"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"curly","children":[{"attributes":{},"tag":"Identifier","children":["DefaultDict"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.Phase"},"tag":"reference","children":["Phase"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Identifier","children":["MVHistory"],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"->","children":[{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"->","children":["->"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["MVHistory"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"!","children":["!"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["haskey"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["metricsepoch"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["metricsepoch"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"curly","children":[{"attributes":{},"tag":"Identifier","children":["DefaultDict"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.Phase"},"tag":"reference","children":["Phase"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Identifier","children":["MVHistory"],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"->","children":[{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"->","children":["->"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["MVHistory"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.on"},"tag":"reference","children":["on"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.EpochBegin"},"tag":"reference","children":["EpochBegin"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.Phase"},"tag":"reference","children":["Phase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["metrics"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Metrics"},"tag":"reference","children":["Metrics"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["foreach"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.reset!"},"tag":"reference","children":["reset!"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["metrics"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["metrics"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.on"},"tag":"reference","children":["on"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.StepEnd"},"tag":"reference","children":["StepEnd"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["metrics"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Metrics"},"tag":"reference","children":["Metrics"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["metricsstep"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["metricsstep"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["step"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["steps"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"for","children":[{"attributes":{},"tag":"for","children":["for"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"in","children":["in"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["metrics"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["metrics"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.step!"},"tag":"reference","children":["step!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["val"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.stepvalue"},"tag":"reference","children":["stepvalue"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["val"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"!==","children":["!=="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["nothing"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["metricsstep"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["metricsstep"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["push!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["metricsstep"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["Symbol"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.metricname"},"tag":"reference","children":["metricname"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["step"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["val"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.on"},"tag":"reference","children":["on"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.EpochEnd"},"tag":"reference","children":["EpochEnd"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["metrics"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Metrics"},"tag":"reference","children":["Metrics"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["epoch"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["epochs"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"for","children":[{"attributes":{},"tag":"for","children":["for"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"in","children":["in"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["metrics"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["metrics"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["val"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.epochvalue"},"tag":"reference","children":["epochvalue"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["val"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"!==","children":["!=="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["nothing"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["metricsepoch"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["metricsepoch"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["push!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["metricsepoch"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["Symbol"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.metricname"},"tag":"reference","children":["metricname"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["epoch"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["val"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"p","children":["AbstractMetric interface"],"type":"node"}],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" abstract type AbstractMetric\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Abstract type for metrics passed to [`Metrics`](#).\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["For most use cases, you should use [`Metric`](#), the standard\n"],"type":"node"},{"attributes":{},"tag":"String","children":["implementation.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["## Interface\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["If [`Metric`](#) doesn't fit your use case, you can create\n"],"type":"node"},{"attributes":{},"tag":"String","children":["a new subtype of `AbstractMetric` and implement the following\n"],"type":"node"},{"attributes":{},"tag":"String","children":["methods to make it compatible with [`Metrics`](#):\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- [`reset!`](#)`(metric)`\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- [`step!`](#)`(metric, learner)`\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- [`stepvalue`](#)`(metric)`\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- [`epochvalue`](#)`(metric)`\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- [`metricname`](#)`(metric)`\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"abstract","children":[{"attributes":{},"tag":"abstract","children":["abstract"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"type","children":["type"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.AbstractMetric"},"tag":"reference","children":["AbstractMetric"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.step!"},"tag":"reference","children":["step!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["_"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.step!"},"tag":"reference","children":["step!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"mutable","children":["mutable"],"type":"node"},{"attributes":{},"tag":"true","children":[""],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"curly","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Metric"},"tag":"reference","children":["Metric"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["T"],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.AbstractMetric"},"tag":"reference","children":["AbstractMetric"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["metricfn"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Any"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["statistic"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"curly","children":[{"attributes":{},"tag":"Identifier","children":["OnlineStat"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["T"],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["_statistic"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Any"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["name"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Any"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["device"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Any"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["P"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Any"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["last"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"curly","children":[{"attributes":{},"tag":"Identifier","children":["Union"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Nothing"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Identifier","children":["T"],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"where","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Base"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["show"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["io"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["IO"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"curly","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Metric"},"tag":"reference","children":["Metric"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["T"],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"where","children":["where"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["T"],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["print"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["io"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Metric("],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["name"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":[")"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" Metric(metricfn[; statistic, device, name])\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Implementation of [`AbstractMetric`](#) that can be used with the\n"],"type":"node"},{"attributes":{},"tag":"String","children":["[`Metrics`](#) callback.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["## Arguments\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Positional:\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- `metricfn(ŷs, ys)` should return a number.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Keyword:\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- `statistic` is a `OnlineStats.Statistic` that is updated after every step.\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" The default is `OnlineStats.Mean()`\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- `name` is used for printing.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- `device` is a function applied to `ŷs` and `ys`\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" before passing them to `metricfn`. The default is `Flux.cpu` so that\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" the callback works if `metricfn` doesn't support arrays from other device\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" types. If, for example, `metricfn` works on `CurArray`s, you can pass\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" `device = Flux.gpu`.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- `phase = Phase`: a (sub)type of [`Phase`](#) that restricts for which phases the\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" metric is computed.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["## Examples\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- `Metric(accuracy)`\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- `Metric(Flux.mse, device = gpu, name = \"Mean Squared Error\")`\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- `Metric(Flux.mae, device = gpu)`\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["```julia\n"],"type":"node"},{"attributes":{},"tag":"String","children":["cb = Metric(Flux.mse, device = gpu, name = \"Mean Squared Error\")\n"],"type":"node"},{"attributes":{},"tag":"String","children":["```\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["If a metric is expensive to compute and you don't want it to slow down the\n"],"type":"node"},{"attributes":{},"tag":"String","children":["training phase, you can compute it on the validation phase only:\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["```julia\n"],"type":"node"},{"attributes":{},"tag":"String","children":["cb = Metric(expensivemetric, P = ValidationPhase)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["```\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Metric"},"tag":"reference","children":["Metric"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["metricfn"],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["name"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["uppercasefirst"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["string"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["metricfn"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["statistic"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["Mean"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["device"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cpu"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.Phase"},"tag":"reference","children":["Phase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Metric"},"tag":"reference","children":["Metric"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["metricfn"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["deepcopy"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["statistic"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["statistic"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["name"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["device"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["nothing"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.reset!"},"tag":"reference","children":["reset!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Metric"},"tag":"reference","children":["Metric"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["statistic"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["deepcopy"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["_statistic"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.step!"},"tag":"reference","children":["step!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Metric"},"tag":"reference","children":["Metric"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"isa","children":["isa"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["P"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"Identifier","children":["ŷs"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ys"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["device"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["step"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["ŷs"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["step"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["ys"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["last"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["metricfn"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ŷs"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ys"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["OnlineStats"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.fit!"},"tag":"reference","children":["fit!"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["statistic"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["last"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"else","children":["else"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["last"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["nothing"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.stepvalue"},"tag":"reference","children":["stepvalue"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Metric"},"tag":"reference","children":["Metric"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["last"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.epochvalue"},"tag":"reference","children":["epochvalue"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Metric"},"tag":"reference","children":["Metric"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["isnothing"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["last"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["nothing"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"else","children":["else"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["OnlineStats"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["value"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["statistic"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.metricname"},"tag":"reference","children":["metricname"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Metric"},"tag":"reference","children":["Metric"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["name"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"p","children":["Loss Metric"],"type":"node"}],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"mutable","children":["mutable"],"type":"node"},{"attributes":{},"tag":"true","children":[""],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loss"},"tag":"reference","children":["Loss"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.AbstractMetric"},"tag":"reference","children":["AbstractMetric"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["statistic"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Any"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["_statistic"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Any"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["last"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Any"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["name"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Any"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loss"},"tag":"reference","children":["Loss"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["weight"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["EqualWeight"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["name"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Loss"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["stat"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["Mean"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["weight"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["weight"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loss"},"tag":"reference","children":["Loss"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["deepcopy"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["stat"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["stat"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["nothing"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["name"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.reset!"},"tag":"reference","children":["reset!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["loss"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loss"},"tag":"reference","children":["Loss"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["loss"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["statistic"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["deepcopy"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["loss"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["_statistic"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.step!"},"tag":"reference","children":["step!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loss"},"tag":"reference","children":["Loss"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["_"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["last"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["step"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["loss"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["OnlineStats"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.fit!"},"tag":"reference","children":["fit!"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["statistic"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["last"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Base"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["show"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["io"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["IO"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loss"},"tag":"reference","children":["Loss"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["print"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["io"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Loss()"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.stepvalue"},"tag":"reference","children":["stepvalue"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loss"},"tag":"reference","children":["Loss"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["last"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.epochvalue"},"tag":"reference","children":["epochvalue"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loss"},"tag":"reference","children":["Loss"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["OnlineStats"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["value"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["statistic"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.metricname"},"tag":"reference","children":["metricname"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loss"},"tag":"reference","children":["Loss"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["name"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"p","children":["Utility"],"type":"node"}],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.SmoothLoss"},"tag":"reference","children":["SmoothLoss"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["β"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Float","children":["0.02"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loss"},"tag":"reference","children":["Loss"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["OnlineStats"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["ExponentialWeight"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Integer","children":["1"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"-","children":["-"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["β"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["name"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["SmoothLoss"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["testset"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Metric"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"begin","children":["begin"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Metrics"},"tag":"reference","children":["Metrics"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Metric"},"tag":"reference","children":["Metric"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.accuracy"},"tag":"reference","children":["accuracy"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.ValidationPhase"},"tag":"reference","children":["ValidationPhase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.testlearner"},"tag":"reference","children":["testlearner"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Recorder"},"tag":"reference","children":["Recorder"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["test_nowarn"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.fit!"},"tag":"reference","children":["fit!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["1"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["test"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Accuracy"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"∈","children":["∈"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["keys"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["metricsstep"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.ValidationPhase"},"tag":"reference","children":["ValidationPhase"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["test"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"!","children":["!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Accuracy"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"∈","children":["∈"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["keys"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["metricsstep"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.TrainingPhase"},"tag":"reference","children":["TrainingPhase"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["test"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Accuracy"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"∈","children":["∈"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["keys"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["metricsepoch"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.ValidationPhase"},"tag":"reference","children":["ValidationPhase"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["test"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"!","children":["!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Accuracy"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"∈","children":["∈"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["keys"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["metricsepoch"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.TrainingPhase"},"tag":"reference","children":["TrainingPhase"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file +{"attributes":{"backlinks":[],"path":"/home/runner/.julia/packages/FluxTraining/imTF4/src/callbacks/metrics.jl","package_id":"FluxTraining@dev","title":"FluxTraining/callbacks/metrics.jl","module_id":"FluxTraining"},"tag":"sourcefile","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" Metrics(metrics...) <: Callback\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Callback that tracks metrics during training.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["You can pass any number of `metrics` with every argument being\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- an [`AbstractMetric`](#) like [`Metric`](#); or\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- a function `f(ŷs, ys) -> val`\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["This callback is added by default to every [`Learner`](#) unless you pass in\n"],"type":"node"},{"attributes":{},"tag":"String","children":["`usedefaultcallbacks = false`. A metric tracking `learner.lossfn` [`Loss`](#)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["is included by default.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["The computed metrics can be access in `learner.cbstate.metricsstep` and\n"],"type":"node"},{"attributes":{},"tag":"String","children":["`learner.cbstate.metricsepoch` for steps and epochs, respectively.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["## Examples\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Track [`accuracy`](#):\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["```julia\n"],"type":"node"},{"attributes":{},"tag":"String","children":["cb = Metrics(accuracy)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["```\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Pass in [`Metric`]s:\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["```julia\n"],"type":"node"},{"attributes":{},"tag":"String","children":["cb = Metrics(\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" Metric(Flux.mse, device = gpu),\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" Metric(Flux.mae, device = gpu)\n"],"type":"node"},{"attributes":{},"tag":"String","children":[")\n"],"type":"node"},{"attributes":{},"tag":"String","children":["```\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Metrics"},"tag":"reference","children":["Metrics"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Callback"},"tag":"reference","children":["Callback"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["metrics"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Tuple"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Metrics"},"tag":"reference","children":["Metrics"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"...","children":[{"attributes":{},"tag":"Identifier","children":["metrics"],"type":"node"},{"attributes":{},"tag":"...","children":["..."],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["new"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["Tuple"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"generator","children":[{"attributes":{},"tag":"?","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["m"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"isa","children":["isa"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.AbstractMetric"},"tag":"reference","children":["AbstractMetric"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"?","children":["?"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["m"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Metric"},"tag":"reference","children":["Metric"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["m"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"for","children":["for"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["m"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"in","children":["in"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loss"},"tag":"reference","children":["Loss"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"...","children":[{"attributes":{},"tag":"Identifier","children":["metrics"],"type":"node"},{"attributes":{},"tag":"...","children":["..."],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.runafter"},"tag":"reference","children":["runafter"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Metrics"},"tag":"reference","children":["Metrics"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Recorder"},"tag":"reference","children":["Recorder"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.stateaccess"},"tag":"reference","children":["stateaccess"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Metrics"},"tag":"reference","children":["Metrics"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["metricsstep"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Write"},"tag":"reference","children":["Write"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["metricsepoch"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Write"},"tag":"reference","children":["Write"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Read"},"tag":"reference","children":["Read"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["step"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Read"},"tag":"reference","children":["Read"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Base"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["show"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["io"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["IO"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["metrics"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Metrics"},"tag":"reference","children":["Metrics"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["print"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["io"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Metrics("],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["join"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["string"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["metrics"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["metrics"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":[", "],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":[")"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"p","children":["store metrics in ",{"attributes":{},"tag":"code","children":["cbstate"],"type":"node"}," so other callbacks can access them"],"type":"node"}],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.init!"},"tag":"reference","children":["init!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["metrics"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Metrics"},"tag":"reference","children":["Metrics"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"||","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["length"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["metrics"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["metrics"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"==","children":["=="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["length"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["unique"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.metricname"},"tag":"reference","children":["metricname"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["metrics"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["metrics"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"||","children":["||"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["error"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Multiple metrics have the same name!"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"!","children":["!"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["haskey"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["metricsstep"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["metricsstep"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"curly","children":[{"attributes":{},"tag":"Identifier","children":["DefaultDict"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.Phase"},"tag":"reference","children":["Phase"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Identifier","children":["MVHistory"],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"->","children":[{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"->","children":["->"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["MVHistory"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"!","children":["!"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["haskey"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["metricsepoch"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["metricsepoch"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"curly","children":[{"attributes":{},"tag":"Identifier","children":["DefaultDict"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.Phase"},"tag":"reference","children":["Phase"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Identifier","children":["MVHistory"],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"->","children":[{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"->","children":["->"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["MVHistory"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.on"},"tag":"reference","children":["on"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.EpochBegin"},"tag":"reference","children":["EpochBegin"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.Phase"},"tag":"reference","children":["Phase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["metrics"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Metrics"},"tag":"reference","children":["Metrics"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["foreach"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.reset!"},"tag":"reference","children":["reset!"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["metrics"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["metrics"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.on"},"tag":"reference","children":["on"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.StepEnd"},"tag":"reference","children":["StepEnd"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["metrics"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Metrics"},"tag":"reference","children":["Metrics"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["metricsstep"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["metricsstep"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["step"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["steps"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"for","children":[{"attributes":{},"tag":"for","children":["for"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"in","children":["in"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["metrics"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["metrics"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.step!"},"tag":"reference","children":["step!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["val"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.stepvalue"},"tag":"reference","children":["stepvalue"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["val"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"!==","children":["!=="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["nothing"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["metricsstep"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["metricsstep"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["push!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["metricsstep"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["Symbol"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.metricname"},"tag":"reference","children":["metricname"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["step"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["val"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.on"},"tag":"reference","children":["on"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.EpochEnd"},"tag":"reference","children":["EpochEnd"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["metrics"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Metrics"},"tag":"reference","children":["Metrics"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["epoch"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["epochs"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"for","children":[{"attributes":{},"tag":"for","children":["for"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"in","children":["in"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["metrics"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["metrics"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["val"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.epochvalue"},"tag":"reference","children":["epochvalue"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["val"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"!==","children":["!=="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["nothing"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["metricsepoch"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["metricsepoch"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["push!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["metricsepoch"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["Symbol"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.metricname"},"tag":"reference","children":["metricname"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["epoch"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["val"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"p","children":["AbstractMetric interface"],"type":"node"}],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" abstract type AbstractMetric\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Abstract type for metrics passed to [`Metrics`](#).\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["For most use cases, you should use [`Metric`](#), the standard\n"],"type":"node"},{"attributes":{},"tag":"String","children":["implementation.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["## Interface\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["If [`Metric`](#) doesn't fit your use case, you can create\n"],"type":"node"},{"attributes":{},"tag":"String","children":["a new subtype of `AbstractMetric` and implement the following\n"],"type":"node"},{"attributes":{},"tag":"String","children":["methods to make it compatible with [`Metrics`](#):\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- [`reset!`](#)`(metric)`\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- [`step!`](#)`(metric, learner)`\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- [`stepvalue`](#)`(metric)`\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- [`epochvalue`](#)`(metric)`\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- [`metricname`](#)`(metric)`\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"abstract","children":[{"attributes":{},"tag":"abstract","children":["abstract"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"type","children":["type"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.AbstractMetric"},"tag":"reference","children":["AbstractMetric"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.step!"},"tag":"reference","children":["step!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["_"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.step!"},"tag":"reference","children":["step!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"mutable","children":["mutable"],"type":"node"},{"attributes":{},"tag":"true","children":[""],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"curly","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Metric"},"tag":"reference","children":["Metric"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["T"],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.AbstractMetric"},"tag":"reference","children":["AbstractMetric"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["metricfn"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Any"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["statistic"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"curly","children":[{"attributes":{},"tag":"Identifier","children":["OnlineStat"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["T"],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["_statistic"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Any"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["name"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Any"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["device"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Any"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["P"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Any"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["last"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"curly","children":[{"attributes":{},"tag":"Identifier","children":["Union"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Nothing"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Identifier","children":["T"],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"where","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Base"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["show"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["io"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["IO"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"curly","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Metric"},"tag":"reference","children":["Metric"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["T"],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"where","children":["where"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["T"],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["print"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["io"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Metric("],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["name"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":[")"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" Metric(metricfn[; statistic, device, name])\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Implementation of [`AbstractMetric`](#) that can be used with the\n"],"type":"node"},{"attributes":{},"tag":"String","children":["[`Metrics`](#) callback.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["## Arguments\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Positional:\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- `metricfn(ŷs, ys)` should return a number.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Keyword:\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- `statistic` is a `OnlineStats.Statistic` that is updated after every step.\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" The default is `OnlineStats.Mean()`\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- `name` is used for printing.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- `device` is a function applied to `ŷs` and `ys`\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" before passing them to `metricfn`. The default is `Flux.cpu` so that\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" the callback works if `metricfn` doesn't support arrays from other device\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" types. If, for example, `metricfn` works on `CurArray`s, you can pass\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" `device = Flux.gpu`.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- `phase = Phase`: a (sub)type of [`Phase`](#) that restricts for which phases the\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" metric is computed.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["## Examples\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- `Metric(accuracy)`\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- `Metric(Flux.mse, device = gpu, name = \"Mean Squared Error\")`\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- `Metric(Flux.mae, device = gpu)`\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["```julia\n"],"type":"node"},{"attributes":{},"tag":"String","children":["cb = Metric(Flux.mse, device = gpu, name = \"Mean Squared Error\")\n"],"type":"node"},{"attributes":{},"tag":"String","children":["```\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["If a metric is expensive to compute and you don't want it to slow down the\n"],"type":"node"},{"attributes":{},"tag":"String","children":["training phase, you can compute it on the validation phase only:\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["```julia\n"],"type":"node"},{"attributes":{},"tag":"String","children":["cb = Metric(expensivemetric, P = ValidationPhase)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["```\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Metric"},"tag":"reference","children":["Metric"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["metricfn"],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["name"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["uppercasefirst"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["string"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["metricfn"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["statistic"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["Mean"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["device"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cpu"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.Phase"},"tag":"reference","children":["Phase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Metric"},"tag":"reference","children":["Metric"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["metricfn"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["deepcopy"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["statistic"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["statistic"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["name"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["device"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["nothing"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.reset!"},"tag":"reference","children":["reset!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Metric"},"tag":"reference","children":["Metric"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["statistic"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["deepcopy"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["_statistic"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.step!"},"tag":"reference","children":["step!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Metric"},"tag":"reference","children":["Metric"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"isa","children":["isa"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["P"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"Identifier","children":["ŷs"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ys"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["device"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["step"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["ŷs"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["step"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["ys"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["last"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["metricfn"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ŷs"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ys"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["OnlineStats"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.fit!"},"tag":"reference","children":["fit!"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["statistic"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["last"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"else","children":["else"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["last"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["nothing"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.stepvalue"},"tag":"reference","children":["stepvalue"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Metric"},"tag":"reference","children":["Metric"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["last"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.epochvalue"},"tag":"reference","children":["epochvalue"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Metric"},"tag":"reference","children":["Metric"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["isnothing"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["last"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["nothing"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"else","children":["else"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["OnlineStats"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["value"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["statistic"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.metricname"},"tag":"reference","children":["metricname"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Metric"},"tag":"reference","children":["Metric"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["name"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"p","children":["Loss Metric"],"type":"node"}],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"mutable","children":["mutable"],"type":"node"},{"attributes":{},"tag":"true","children":[""],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loss"},"tag":"reference","children":["Loss"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.AbstractMetric"},"tag":"reference","children":["AbstractMetric"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["statistic"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Any"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["_statistic"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Any"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["last"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Any"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["name"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Any"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loss"},"tag":"reference","children":["Loss"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["weight"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["EqualWeight"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["name"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Loss"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["stat"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["Mean"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["weight"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["weight"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loss"},"tag":"reference","children":["Loss"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["deepcopy"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["stat"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["stat"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["nothing"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["name"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.reset!"},"tag":"reference","children":["reset!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["loss"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loss"},"tag":"reference","children":["Loss"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["loss"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["statistic"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["deepcopy"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["loss"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["_statistic"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.step!"},"tag":"reference","children":["step!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loss"},"tag":"reference","children":["Loss"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["_"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["last"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["step"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["loss"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["OnlineStats"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.fit!"},"tag":"reference","children":["fit!"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["statistic"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["last"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Base"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["show"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["io"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["IO"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loss"},"tag":"reference","children":["Loss"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["print"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["io"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Loss()"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.stepvalue"},"tag":"reference","children":["stepvalue"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loss"},"tag":"reference","children":["Loss"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["last"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.epochvalue"},"tag":"reference","children":["epochvalue"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loss"},"tag":"reference","children":["Loss"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["OnlineStats"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["value"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["statistic"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.metricname"},"tag":"reference","children":["metricname"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loss"},"tag":"reference","children":["Loss"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["metric"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["name"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"p","children":["Utility"],"type":"node"}],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.SmoothLoss"},"tag":"reference","children":["SmoothLoss"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["β"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Float","children":["0.02"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Loss"},"tag":"reference","children":["Loss"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["OnlineStats"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["ExponentialWeight"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Integer","children":["1"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"-","children":["-"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["β"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["name"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["SmoothLoss"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["testset"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Metric"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"begin","children":["begin"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Metrics"},"tag":"reference","children":["Metrics"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Metric"},"tag":"reference","children":["Metric"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.accuracy"},"tag":"reference","children":["accuracy"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.ValidationPhase"},"tag":"reference","children":["ValidationPhase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.testlearner"},"tag":"reference","children":["testlearner"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Recorder"},"tag":"reference","children":["Recorder"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["test_nowarn"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.fit!"},"tag":"reference","children":["fit!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["1"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["test"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Accuracy"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"∈","children":["∈"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["keys"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["metricsstep"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.ValidationPhase"},"tag":"reference","children":["ValidationPhase"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["test"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"!","children":["!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Accuracy"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"∈","children":["∈"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["keys"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["metricsstep"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.TrainingPhase"},"tag":"reference","children":["TrainingPhase"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["test"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Accuracy"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"∈","children":["∈"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["keys"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["metricsepoch"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.ValidationPhase"},"tag":"reference","children":["ValidationPhase"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["test"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"!","children":["!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Accuracy"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"∈","children":["∈"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["keys"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["metricsepoch"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.TrainingPhase"},"tag":"reference","children":["TrainingPhase"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file diff --git a/data/FluxTraining@dev/src/callbacks/phases.jl.json b/data/FluxTraining@dev/src/callbacks/phases.jl.json index c59259bd4..c1fe988df 100644 --- a/data/FluxTraining@dev/src/callbacks/phases.jl.json +++ b/data/FluxTraining@dev/src/callbacks/phases.jl.json @@ -1 +1 @@ -{"attributes":{"backlinks":[],"path":"/home/runner/.julia/packages/FluxTraining/xCOPx/src/callbacks/phases.jl","package_id":"FluxTraining@dev","title":"FluxTraining/callbacks/phases.jl","module_id":"FluxTraining"},"tag":"sourcefile","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"module","children":[{"attributes":{},"tag":"module","children":["module"],"type":"node"},{"attributes":{},"tag":"true","children":[""],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases"},"tag":"reference","children":["Phases"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" abstract type Phase\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Abstract supertype for all phases. See `subtypes(FluxTraining.Phase)`.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["A `Phase` is used in dispatch for training loop functions [`step!`](#)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["and [`epoch!`](#) as well as in [`Callback`](#) handler methods [`on`](#).\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"abstract","children":[{"attributes":{},"tag":"abstract","children":["abstract"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"type","children":["type"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.Phase"},"tag":"reference","children":["Phase"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" abstract type AbstractTrainingPhase <: Phase\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["An abstract type for phases where parameter updates\n"],"type":"node"},{"attributes":{},"tag":"String","children":["are being made. This exists so callbacks can dispatch on it and work\n"],"type":"node"},{"attributes":{},"tag":"String","children":["with custom training phases.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["The default implementation for supervised tasks is [`TrainingPhase`](#).\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"abstract","children":[{"attributes":{},"tag":"abstract","children":["abstract"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"type","children":["type"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.AbstractTrainingPhase"},"tag":"reference","children":["AbstractTrainingPhase"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.Phase"},"tag":"reference","children":["Phase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" TrainingPhase() <: AbstractTrainingPhase\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["A regular training phase for supervised learning. It iterates over batches\n"],"type":"node"},{"attributes":{},"tag":"String","children":["in `learner.data.training` and updates the model parameters\n"],"type":"node"},{"attributes":{},"tag":"String","children":["using `learner.optim` after calculating the gradients.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Throws the following events in this order:\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- [`EpochBegin`](#) when an epoch starts,\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- [`StepBegin`](#) when a step starts,\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- [`LossBegin`](#) after the forward pass but before loss calculation,\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- [`BackwardBegin`](#) after loss calculation but before backward pass,\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- [`BackwardEnd`](#) after the bacward pass but before the optimization\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" step,\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- [`StepEnd`](#) when a step ends; and\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- [`EpochEnd`](#) when an epoch ends\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["It writes the following step state to `learner.state`, grouped by the\n"],"type":"node"},{"attributes":{},"tag":"String","children":["event from which on it is available.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- `StepBegin`:\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" - `xs` and `ys`: encoded input and target (batch)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- `LossBegin`:\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" - `ŷs`: model output\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- `BackwardBegin`:\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" - `loss`: loss\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- `BackwardEnd`:\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" - `grads`: calculated gradients\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.TrainingPhase"},"tag":"reference","children":["TrainingPhase"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.AbstractTrainingPhase"},"tag":"reference","children":["AbstractTrainingPhase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" abstract type AbstractValidationPhase <: Phase\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["An abstract type for phases where no parameter updates\n"],"type":"node"},{"attributes":{},"tag":"String","children":["are being made. This exists so callbacks can dispatch on it and work\n"],"type":"node"},{"attributes":{},"tag":"String","children":["with custom validation phases.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["The default implementation for supervised tasks is [`ValidationPhase`](#).\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"abstract","children":[{"attributes":{},"tag":"abstract","children":["abstract"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"type","children":["type"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.AbstractValidationPhase"},"tag":"reference","children":["AbstractValidationPhase"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.Phase"},"tag":"reference","children":["Phase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" ValidationPhase()\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["A regular validation phase. It iterates over batches\n"],"type":"node"},{"attributes":{},"tag":"String","children":["in `learner.data.validation` and performs a forward pass.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Throws the following events: [`EpochBegin`](#), [`StepBegin`](#),\n"],"type":"node"},{"attributes":{},"tag":"String","children":["[`LossBegin`](#), [`StepEnd`](#), [`EpochEnd`](#).\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Throws the following events in this order:\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- [`EpochBegin`](#) when an epoch starts,\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- [`StepBegin`](#) when a step starts,\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- [`LossBegin`](#) after the forward pass but before loss calculation,\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- [`StepEnd`](#) when a step ends; and\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- [`EpochEnd`](#) when an epoch ends\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["It writes the following step state to `learner.state`, grouped by the\n"],"type":"node"},{"attributes":{},"tag":"String","children":["event from which on it is available.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- `StepBegin`:\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" - `xs` and `ys`: encoded input and target (batch)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- `LossBegin`:\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" - `ŷs`: model output\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- `StepEnd`:\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" - `loss`: loss\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.ValidationPhase"},"tag":"reference","children":["ValidationPhase"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.AbstractValidationPhase"},"tag":"reference","children":["AbstractValidationPhase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"export","children":[{"attributes":{},"tag":"export","children":["export"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.Phase"},"tag":"reference","children":["Phase"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.AbstractTrainingPhase"},"tag":"reference","children":["AbstractTrainingPhase"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.TrainingPhase"},"tag":"reference","children":["TrainingPhase"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.AbstractValidationPhase"},"tag":"reference","children":["AbstractValidationPhase"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.ValidationPhase"},"tag":"reference","children":["ValidationPhase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"p","children":["module"],"type":"node"}],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases"},"tag":"reference","children":["Phases"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file +{"attributes":{"backlinks":[],"path":"/home/runner/.julia/packages/FluxTraining/imTF4/src/callbacks/phases.jl","package_id":"FluxTraining@dev","title":"FluxTraining/callbacks/phases.jl","module_id":"FluxTraining"},"tag":"sourcefile","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"module","children":[{"attributes":{},"tag":"module","children":["module"],"type":"node"},{"attributes":{},"tag":"true","children":[""],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases"},"tag":"reference","children":["Phases"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" abstract type Phase\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Abstract supertype for all phases. See `subtypes(FluxTraining.Phase)`.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["A `Phase` is used in dispatch for training loop functions [`step!`](#)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["and [`epoch!`](#) as well as in [`Callback`](#) handler methods [`on`](#).\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"abstract","children":[{"attributes":{},"tag":"abstract","children":["abstract"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"type","children":["type"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.Phase"},"tag":"reference","children":["Phase"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" abstract type AbstractTrainingPhase <: Phase\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["An abstract type for phases where parameter updates\n"],"type":"node"},{"attributes":{},"tag":"String","children":["are being made. This exists so callbacks can dispatch on it and work\n"],"type":"node"},{"attributes":{},"tag":"String","children":["with custom training phases.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["The default implementation for supervised tasks is [`TrainingPhase`](#).\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"abstract","children":[{"attributes":{},"tag":"abstract","children":["abstract"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"type","children":["type"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.AbstractTrainingPhase"},"tag":"reference","children":["AbstractTrainingPhase"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.Phase"},"tag":"reference","children":["Phase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" TrainingPhase() <: AbstractTrainingPhase\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["A regular training phase for supervised learning. It iterates over batches\n"],"type":"node"},{"attributes":{},"tag":"String","children":["in `learner.data.training` and updates the model parameters\n"],"type":"node"},{"attributes":{},"tag":"String","children":["using `learner.optim` after calculating the gradients.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Throws the following events in this order:\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- [`EpochBegin`](#) when an epoch starts,\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- [`StepBegin`](#) when a step starts,\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- [`LossBegin`](#) after the forward pass but before loss calculation,\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- [`BackwardBegin`](#) after loss calculation but before backward pass,\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- [`BackwardEnd`](#) after the bacward pass but before the optimization\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" step,\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- [`StepEnd`](#) when a step ends; and\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- [`EpochEnd`](#) when an epoch ends\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["It writes the following step state to `learner.state`, grouped by the\n"],"type":"node"},{"attributes":{},"tag":"String","children":["event from which on it is available.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- `StepBegin`:\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" - `xs` and `ys`: encoded input and target (batch)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- `LossBegin`:\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" - `ŷs`: model output\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- `BackwardBegin`:\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" - `loss`: loss\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- `BackwardEnd`:\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" - `grads`: calculated gradients\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.TrainingPhase"},"tag":"reference","children":["TrainingPhase"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.AbstractTrainingPhase"},"tag":"reference","children":["AbstractTrainingPhase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" abstract type AbstractValidationPhase <: Phase\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["An abstract type for phases where no parameter updates\n"],"type":"node"},{"attributes":{},"tag":"String","children":["are being made. This exists so callbacks can dispatch on it and work\n"],"type":"node"},{"attributes":{},"tag":"String","children":["with custom validation phases.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["The default implementation for supervised tasks is [`ValidationPhase`](#).\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"abstract","children":[{"attributes":{},"tag":"abstract","children":["abstract"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"type","children":["type"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.AbstractValidationPhase"},"tag":"reference","children":["AbstractValidationPhase"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.Phase"},"tag":"reference","children":["Phase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" ValidationPhase()\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["A regular validation phase. It iterates over batches\n"],"type":"node"},{"attributes":{},"tag":"String","children":["in `learner.data.validation` and performs a forward pass.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Throws the following events: [`EpochBegin`](#), [`StepBegin`](#),\n"],"type":"node"},{"attributes":{},"tag":"String","children":["[`LossBegin`](#), [`StepEnd`](#), [`EpochEnd`](#).\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Throws the following events in this order:\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- [`EpochBegin`](#) when an epoch starts,\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- [`StepBegin`](#) when a step starts,\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- [`LossBegin`](#) after the forward pass but before loss calculation,\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- [`StepEnd`](#) when a step ends; and\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- [`EpochEnd`](#) when an epoch ends\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["It writes the following step state to `learner.state`, grouped by the\n"],"type":"node"},{"attributes":{},"tag":"String","children":["event from which on it is available.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- `StepBegin`:\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" - `xs` and `ys`: encoded input and target (batch)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- `LossBegin`:\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" - `ŷs`: model output\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- `StepEnd`:\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" - `loss`: loss\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.ValidationPhase"},"tag":"reference","children":["ValidationPhase"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.AbstractValidationPhase"},"tag":"reference","children":["AbstractValidationPhase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"export","children":[{"attributes":{},"tag":"export","children":["export"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.Phase"},"tag":"reference","children":["Phase"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.AbstractTrainingPhase"},"tag":"reference","children":["AbstractTrainingPhase"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.TrainingPhase"},"tag":"reference","children":["TrainingPhase"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.AbstractValidationPhase"},"tag":"reference","children":["AbstractValidationPhase"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.ValidationPhase"},"tag":"reference","children":["ValidationPhase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"p","children":["module"],"type":"node"}],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"using","children":[{"attributes":{},"tag":"using","children":["using"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases"},"tag":"reference","children":["Phases"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file diff --git a/data/FluxTraining@dev/src/callbacks/protect.jl.json b/data/FluxTraining@dev/src/callbacks/protect.jl.json index 5e0f633a1..78eeeccdc 100644 --- a/data/FluxTraining@dev/src/callbacks/protect.jl.json +++ b/data/FluxTraining@dev/src/callbacks/protect.jl.json @@ -1 +1 @@ -{"attributes":{"backlinks":[],"path":"/home/runner/.julia/packages/FluxTraining/xCOPx/src/callbacks/protect.jl","package_id":"FluxTraining@dev","title":"FluxTraining/callbacks/protect.jl","module_id":"FluxTraining"},"tag":"sourcefile","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ProtectedException"},"tag":"reference","children":["ProtectedException"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Exception"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["msg"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["String"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"abstract","children":[{"attributes":{},"tag":"abstract","children":["abstract"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"type","children":["type"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Permission"},"tag":"reference","children":["Permission"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Read"},"tag":"reference","children":["Read"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Permission"},"tag":"reference","children":["Permission"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Write"},"tag":"reference","children":["Write"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Permission"},"tag":"reference","children":["Permission"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"curly","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Protected"},"tag":"reference","children":["Protected"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["T"],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["T"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["perms"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["NamedTuple"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Base"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["getproperty"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["protected"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Protected"},"tag":"reference","children":["Protected"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["field"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Symbol"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.getfieldperm"},"tag":"reference","children":["getfieldperm"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["getfield"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["protected"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["field"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["get"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["getfield"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["protected"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["perms"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["field"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["nothing"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Base"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["setproperty!"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["protected"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Protected"},"tag":"reference","children":["Protected"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["field"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Symbol"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["x"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.setfieldperm!"},"tag":"reference","children":["setfieldperm!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["getfield"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["protected"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["field"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["x"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["get"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["getfield"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["protected"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["perms"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["field"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["nothing"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Base"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["getindex"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["protected"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Protected"},"tag":"reference","children":["Protected"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["idx"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.getindexperm"},"tag":"reference","children":["getindexperm"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["getfield"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["protected"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["idx"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["get"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["getfield"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["protected"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["perms"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["idx"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["nothing"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Base"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["setindex!"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["protected"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Protected"},"tag":"reference","children":["Protected"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["x"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["idx"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.setindexperm!"},"tag":"reference","children":["setindexperm!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["getfield"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["protected"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["x"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["idx"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["get"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["getfield"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["protected"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["perms"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["idx"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["nothing"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Base"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["haskey"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["d"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Protected"},"tag":"reference","children":["Protected"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["key"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["haskey"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["getfield"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["d"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["key"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"where","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.getindexperm"},"tag":"reference","children":["getindexperm"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["D"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["idx"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["perm"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Nothing"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"where","children":["where"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["D"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["throw"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ProtectedException"},"tag":"reference","children":["ProtectedException"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Read access to "],"type":"node"},{"attributes":{},"tag":"$","children":["$"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["D"],"type":"node"},{"attributes":{},"tag":"String","children":["["],"type":"node"},{"attributes":{},"tag":"$","children":["$"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["idx"],"type":"node"},{"attributes":{},"tag":"String","children":["] disallowed."],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.getindexperm"},"tag":"reference","children":["getindexperm"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["idx"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["perm"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"curly","children":[{"attributes":{},"tag":"Identifier","children":["Union"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Read"},"tag":"reference","children":["Read"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Write"},"tag":"reference","children":["Write"],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["getindex"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["idx"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.getindexperm"},"tag":"reference","children":["getindexperm"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["idx"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["perm"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["NamedTuple"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.protect"},"tag":"reference","children":["protect"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["getindex"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["idx"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["perm"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"where","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.setindexperm!"},"tag":"reference","children":["setindexperm!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["D"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["idx"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["x"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["perm"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"curly","children":[{"attributes":{},"tag":"Identifier","children":["Union"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Read"},"tag":"reference","children":["Read"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Nothing"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["NamedTuple"],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"where","children":["where"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["D"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["throw"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ProtectedException"},"tag":"reference","children":["ProtectedException"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Write access to "],"type":"node"},{"attributes":{},"tag":"$","children":["$"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["D"],"type":"node"},{"attributes":{},"tag":"String","children":["["],"type":"node"},{"attributes":{},"tag":"$","children":["$"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["idx"],"type":"node"},{"attributes":{},"tag":"String","children":["] disallowed."],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.setindexperm!"},"tag":"reference","children":["setindexperm!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["x"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["idx"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["perm"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Write"},"tag":"reference","children":["Write"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["setindex!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["x"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["idx"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"where","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.getfieldperm"},"tag":"reference","children":["getfieldperm"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["D"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["field"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["perm"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Nothing"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"where","children":["where"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["D"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["throw"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ProtectedException"},"tag":"reference","children":["ProtectedException"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Read access to "],"type":"node"},{"attributes":{},"tag":"$","children":["$"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["D"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"},{"attributes":{},"tag":"String","children":["."],"type":"node"},{"attributes":{},"tag":"$","children":["$"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["string"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["field"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"},{"attributes":{},"tag":"String","children":[" disallowed."],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.getfieldperm"},"tag":"reference","children":["getfieldperm"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["field"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["perm"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"curly","children":[{"attributes":{},"tag":"Identifier","children":["Union"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Read"},"tag":"reference","children":["Read"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Write"},"tag":"reference","children":["Write"],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["getproperty"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["field"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.getfieldperm"},"tag":"reference","children":["getfieldperm"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["field"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["perm"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["NamedTuple"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.protect"},"tag":"reference","children":["protect"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["getproperty"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["field"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["perm"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"where","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.setfieldperm!"},"tag":"reference","children":["setfieldperm!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["D"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["field"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["x"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["perm"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"curly","children":[{"attributes":{},"tag":"Identifier","children":["Union"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Read"},"tag":"reference","children":["Read"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Nothing"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["NamedTuple"],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"where","children":["where"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["D"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["throw"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ProtectedException"},"tag":"reference","children":["ProtectedException"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Write access to "],"type":"node"},{"attributes":{},"tag":"$","children":["$"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["D"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"},{"attributes":{},"tag":"String","children":["."],"type":"node"},{"attributes":{},"tag":"$","children":["$"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["string"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["field"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"},{"attributes":{},"tag":"String","children":[" disallowed."],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.setfieldperm!"},"tag":"reference","children":["setfieldperm!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["field"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["x"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["perm"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Write"},"tag":"reference","children":["Write"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["setproperty!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["field"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["x"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Base"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["fieldnames"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["protected"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Protected"},"tag":"reference","children":["Protected"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["fieldnames"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["typeof"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["getfield"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["protected"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.protect"},"tag":"reference","children":["protect"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["x"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["perms"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Protected"},"tag":"reference","children":["Protected"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["x"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["perms"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" PropDict(dict)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Like a `Dict{Symbol}`, but attribute syntax can be used to access values.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"curly","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.PropDict"},"tag":"reference","children":["PropDict"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["V"],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["d"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"curly","children":[{"attributes":{},"tag":"Identifier","children":["Dict"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Symbol"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["V"],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Base"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["getproperty"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["d"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.PropDict"},"tag":"reference","children":["PropDict"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["field"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Symbol"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["getfield"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["d"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["d"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["field"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Base"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["setproperty!"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["d"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.PropDict"},"tag":"reference","children":["PropDict"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["field"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Symbol"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["val"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["getfield"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["d"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["d"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["field"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["val"],"type":"node"}],"type":"node"},{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Base"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["propertynames"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["d"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.PropDict"},"tag":"reference","children":["PropDict"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["Tuple"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["keys"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["getfield"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["d"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["d"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Base"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["haskey"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["d"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.PropDict"},"tag":"reference","children":["PropDict"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["key"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["haskey"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["getfield"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["d"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["d"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["key"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Base"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["getindex"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["d"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"curly","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["FluxTraining"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.PropDict"},"tag":"reference","children":["PropDict"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Any"],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["i"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Symbol"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["getproperty"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["d"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["i"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Base"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["keys"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["d"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.PropDict"},"tag":"reference","children":["PropDict"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["keys"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["getfield"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["d"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["d"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Base"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["values"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["d"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.PropDict"},"tag":"reference","children":["PropDict"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["values"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["getfield"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["d"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["d"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Base"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["get"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["d"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.PropDict"},"tag":"reference","children":["PropDict"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"...","children":[{"attributes":{},"tag":"Identifier","children":["args"],"type":"node"},{"attributes":{},"tag":"...","children":["..."],"type":"node"}],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"...","children":[{"attributes":{},"tag":"Identifier","children":["kwargs"],"type":"node"},{"attributes":{},"tag":"...","children":["..."],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["get"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["getfield"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["d"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["d"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"...","children":[{"attributes":{},"tag":"Identifier","children":["args"],"type":"node"},{"attributes":{},"tag":"...","children":["..."],"type":"node"}],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"...","children":[{"attributes":{},"tag":"Identifier","children":["kwargs"],"type":"node"},{"attributes":{},"tag":"...","children":["..."],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.PropDict"},"tag":"reference","children":["PropDict"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"...","children":[{"attributes":{},"tag":"Identifier","children":["args"],"type":"node"},{"attributes":{},"tag":"...","children":["..."],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.PropDict"},"tag":"reference","children":["PropDict"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"curly","children":[{"attributes":{},"tag":"Identifier","children":["Dict"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Symbol"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Any"],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"...","children":[{"attributes":{},"tag":"Identifier","children":["args"],"type":"node"},{"attributes":{},"tag":"...","children":["..."],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"h2","children":["Tests"],"type":"node"}],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["testset"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["`protect`"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"begin","children":["begin"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"mutable","children":["mutable"],"type":"node"},{"attributes":{},"tag":"true","children":[""],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["C"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["x"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Int"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["y"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Int"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"mutable","children":["mutable"],"type":"node"},{"attributes":{},"tag":"true","children":[""],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["B"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["c"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["C"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"mutable","children":["mutable"],"type":"node"},{"attributes":{},"tag":"true","children":[""],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["A"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["b1"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["B"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["b2"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["B"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["makea"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["A"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["B"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["C"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Integer","children":["1"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["2"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["B"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["C"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Integer","children":["3"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["4"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["testset"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["fully protected"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"begin","children":["begin"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["a_p"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.protect"},"tag":"reference","children":["protect"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["makea"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["NamedTuple"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Comment","children":["# protect all child structs of `a`"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["test_throws"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ProtectedException"},"tag":"reference","children":["ProtectedException"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["a_p"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["b1"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"isa","children":["isa"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Protected"},"tag":"reference","children":["Protected"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["testset"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["read direct child"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"begin","children":["begin"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["a_p2"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.protect"},"tag":"reference","children":["protect"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["makea"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["b1"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Read"},"tag":"reference","children":["Read"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Comment","children":["# protect everything but `b1`"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["test_nowarn"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["a_p2"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["b1"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["test_throws"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ProtectedException"},"tag":"reference","children":["ProtectedException"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["a_p2"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["b1"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["C"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Integer","children":["5"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["5"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["testset"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["write direct child"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"begin","children":["begin"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["a_p2"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.protect"},"tag":"reference","children":["protect"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["makea"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["b1"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Write"},"tag":"reference","children":["Write"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Comment","children":["# protect everything but `b1`"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["test_nowarn"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["a_p2"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["b1"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["test_nowarn"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["a_p2"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["b1"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["B"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["C"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Integer","children":["5"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["5"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["testset"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["write nested"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"begin","children":["begin"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["a_p3"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.protect"},"tag":"reference","children":["protect"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["makea"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["b1"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["c"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["x"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Write"},"tag":"reference","children":["Write"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Comment","children":["# allow mutating only a.b1.c.x"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["test_nowarn"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["a_p3"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["b1"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["c"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["x"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["2"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["test_nowarn"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["a_p3"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["b1"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["c"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["x"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["test"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["a_p3"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["b1"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["c"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"isa","children":["isa"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Protected"},"tag":"reference","children":["Protected"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["test_throws"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ProtectedException"},"tag":"reference","children":["ProtectedException"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["a_p3"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["b1"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["c"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["y"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["2"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file +{"attributes":{"backlinks":[],"path":"/home/runner/.julia/packages/FluxTraining/imTF4/src/callbacks/protect.jl","package_id":"FluxTraining@dev","title":"FluxTraining/callbacks/protect.jl","module_id":"FluxTraining"},"tag":"sourcefile","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ProtectedException"},"tag":"reference","children":["ProtectedException"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Exception"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["msg"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["String"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"abstract","children":[{"attributes":{},"tag":"abstract","children":["abstract"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"type","children":["type"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Permission"},"tag":"reference","children":["Permission"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Read"},"tag":"reference","children":["Read"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Permission"},"tag":"reference","children":["Permission"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Write"},"tag":"reference","children":["Write"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Permission"},"tag":"reference","children":["Permission"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"curly","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Protected"},"tag":"reference","children":["Protected"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["T"],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["T"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["perms"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["NamedTuple"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Base"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["getproperty"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["protected"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Protected"},"tag":"reference","children":["Protected"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["field"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Symbol"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.getfieldperm"},"tag":"reference","children":["getfieldperm"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["getfield"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["protected"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["field"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["get"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["getfield"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["protected"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["perms"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["field"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["nothing"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Base"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["setproperty!"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["protected"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Protected"},"tag":"reference","children":["Protected"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["field"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Symbol"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["x"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.setfieldperm!"},"tag":"reference","children":["setfieldperm!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["getfield"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["protected"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["field"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["x"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["get"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["getfield"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["protected"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["perms"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["field"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["nothing"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Base"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["getindex"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["protected"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Protected"},"tag":"reference","children":["Protected"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["idx"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.getindexperm"},"tag":"reference","children":["getindexperm"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["getfield"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["protected"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["idx"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["get"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["getfield"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["protected"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["perms"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["idx"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["nothing"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Base"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["setindex!"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["protected"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Protected"},"tag":"reference","children":["Protected"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["x"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["idx"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.setindexperm!"},"tag":"reference","children":["setindexperm!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["getfield"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["protected"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["x"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["idx"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["get"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["getfield"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["protected"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["perms"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["idx"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["nothing"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Base"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["haskey"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["d"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Protected"},"tag":"reference","children":["Protected"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["key"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["haskey"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["getfield"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["d"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["key"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"where","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.getindexperm"},"tag":"reference","children":["getindexperm"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["D"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["idx"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["perm"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Nothing"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"where","children":["where"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["D"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["throw"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ProtectedException"},"tag":"reference","children":["ProtectedException"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Read access to "],"type":"node"},{"attributes":{},"tag":"$","children":["$"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["D"],"type":"node"},{"attributes":{},"tag":"String","children":["["],"type":"node"},{"attributes":{},"tag":"$","children":["$"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["idx"],"type":"node"},{"attributes":{},"tag":"String","children":["] disallowed."],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.getindexperm"},"tag":"reference","children":["getindexperm"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["idx"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["perm"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"curly","children":[{"attributes":{},"tag":"Identifier","children":["Union"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Read"},"tag":"reference","children":["Read"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Write"},"tag":"reference","children":["Write"],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["getindex"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["idx"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.getindexperm"},"tag":"reference","children":["getindexperm"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["idx"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["perm"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["NamedTuple"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.protect"},"tag":"reference","children":["protect"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["getindex"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["idx"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["perm"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"where","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.setindexperm!"},"tag":"reference","children":["setindexperm!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["D"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["idx"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["x"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["perm"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"curly","children":[{"attributes":{},"tag":"Identifier","children":["Union"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Read"},"tag":"reference","children":["Read"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Nothing"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["NamedTuple"],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"where","children":["where"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["D"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["throw"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ProtectedException"},"tag":"reference","children":["ProtectedException"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Write access to "],"type":"node"},{"attributes":{},"tag":"$","children":["$"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["D"],"type":"node"},{"attributes":{},"tag":"String","children":["["],"type":"node"},{"attributes":{},"tag":"$","children":["$"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["idx"],"type":"node"},{"attributes":{},"tag":"String","children":["] disallowed."],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.setindexperm!"},"tag":"reference","children":["setindexperm!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["x"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["idx"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["perm"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Write"},"tag":"reference","children":["Write"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["setindex!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["x"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["idx"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"where","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.getfieldperm"},"tag":"reference","children":["getfieldperm"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["D"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["field"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["perm"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Nothing"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"where","children":["where"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["D"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["throw"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ProtectedException"},"tag":"reference","children":["ProtectedException"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Read access to "],"type":"node"},{"attributes":{},"tag":"$","children":["$"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["D"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"},{"attributes":{},"tag":"String","children":["."],"type":"node"},{"attributes":{},"tag":"$","children":["$"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["string"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["field"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"},{"attributes":{},"tag":"String","children":[" disallowed."],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.getfieldperm"},"tag":"reference","children":["getfieldperm"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["field"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["perm"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"curly","children":[{"attributes":{},"tag":"Identifier","children":["Union"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Read"},"tag":"reference","children":["Read"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Write"},"tag":"reference","children":["Write"],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["getproperty"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["field"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.getfieldperm"},"tag":"reference","children":["getfieldperm"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["field"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["perm"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["NamedTuple"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.protect"},"tag":"reference","children":["protect"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["getproperty"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["field"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["perm"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"where","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.setfieldperm!"},"tag":"reference","children":["setfieldperm!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["D"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["field"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["x"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["perm"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"curly","children":[{"attributes":{},"tag":"Identifier","children":["Union"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Read"},"tag":"reference","children":["Read"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Nothing"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["NamedTuple"],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"where","children":["where"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["D"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["throw"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ProtectedException"},"tag":"reference","children":["ProtectedException"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Write access to "],"type":"node"},{"attributes":{},"tag":"$","children":["$"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["D"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"},{"attributes":{},"tag":"String","children":["."],"type":"node"},{"attributes":{},"tag":"$","children":["$"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["string"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["field"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"},{"attributes":{},"tag":"String","children":[" disallowed."],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.setfieldperm!"},"tag":"reference","children":["setfieldperm!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["field"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["x"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["perm"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Write"},"tag":"reference","children":["Write"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["setproperty!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["field"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["x"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Base"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["fieldnames"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["protected"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Protected"},"tag":"reference","children":["Protected"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["fieldnames"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["typeof"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["getfield"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["protected"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.protect"},"tag":"reference","children":["protect"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["x"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["perms"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Protected"},"tag":"reference","children":["Protected"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["x"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["perms"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" PropDict(dict)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Like a `Dict{Symbol}`, but attribute syntax can be used to access values.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"curly","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.PropDict"},"tag":"reference","children":["PropDict"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["V"],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["d"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"curly","children":[{"attributes":{},"tag":"Identifier","children":["Dict"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Symbol"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["V"],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Base"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["getproperty"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["d"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.PropDict"},"tag":"reference","children":["PropDict"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["field"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Symbol"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["getfield"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["d"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["d"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["field"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Base"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["setproperty!"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["d"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.PropDict"},"tag":"reference","children":["PropDict"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["field"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Symbol"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["val"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["getfield"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["d"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["d"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["field"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["val"],"type":"node"}],"type":"node"},{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Base"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["propertynames"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["d"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.PropDict"},"tag":"reference","children":["PropDict"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["Tuple"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["keys"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["getfield"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["d"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["d"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Base"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["haskey"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["d"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.PropDict"},"tag":"reference","children":["PropDict"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["key"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["haskey"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["getfield"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["d"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["d"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["key"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Base"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["getindex"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["d"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"curly","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["FluxTraining"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.PropDict"},"tag":"reference","children":["PropDict"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Any"],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["i"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Symbol"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["getproperty"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["d"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["i"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Base"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["keys"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["d"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.PropDict"},"tag":"reference","children":["PropDict"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["keys"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["getfield"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["d"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["d"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Base"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["values"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["d"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.PropDict"},"tag":"reference","children":["PropDict"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["values"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["getfield"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["d"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["d"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Base"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["get"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["d"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.PropDict"},"tag":"reference","children":["PropDict"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"...","children":[{"attributes":{},"tag":"Identifier","children":["args"],"type":"node"},{"attributes":{},"tag":"...","children":["..."],"type":"node"}],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"...","children":[{"attributes":{},"tag":"Identifier","children":["kwargs"],"type":"node"},{"attributes":{},"tag":"...","children":["..."],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["get"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["getfield"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["d"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["d"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"...","children":[{"attributes":{},"tag":"Identifier","children":["args"],"type":"node"},{"attributes":{},"tag":"...","children":["..."],"type":"node"}],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"...","children":[{"attributes":{},"tag":"Identifier","children":["kwargs"],"type":"node"},{"attributes":{},"tag":"...","children":["..."],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.PropDict"},"tag":"reference","children":["PropDict"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"...","children":[{"attributes":{},"tag":"Identifier","children":["args"],"type":"node"},{"attributes":{},"tag":"...","children":["..."],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.PropDict"},"tag":"reference","children":["PropDict"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"curly","children":[{"attributes":{},"tag":"Identifier","children":["Dict"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Symbol"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Any"],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"...","children":[{"attributes":{},"tag":"Identifier","children":["args"],"type":"node"},{"attributes":{},"tag":"...","children":["..."],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"h2","children":["Tests"],"type":"node"}],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["testset"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["`protect`"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"begin","children":["begin"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"mutable","children":["mutable"],"type":"node"},{"attributes":{},"tag":"true","children":[""],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["C"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["x"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Int"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["y"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Int"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"mutable","children":["mutable"],"type":"node"},{"attributes":{},"tag":"true","children":[""],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["B"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["c"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["C"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"mutable","children":["mutable"],"type":"node"},{"attributes":{},"tag":"true","children":[""],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["A"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["b1"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["B"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["b2"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["B"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["makea"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["A"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["B"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["C"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Integer","children":["1"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["2"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["B"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["C"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Integer","children":["3"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["4"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["testset"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["fully protected"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"begin","children":["begin"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["a_p"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.protect"},"tag":"reference","children":["protect"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["makea"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["NamedTuple"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Comment","children":["# protect all child structs of `a`"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["test_throws"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ProtectedException"},"tag":"reference","children":["ProtectedException"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["a_p"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["b1"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"isa","children":["isa"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Protected"},"tag":"reference","children":["Protected"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["testset"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["read direct child"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"begin","children":["begin"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["a_p2"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.protect"},"tag":"reference","children":["protect"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["makea"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["b1"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Read"},"tag":"reference","children":["Read"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Comment","children":["# protect everything but `b1`"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["test_nowarn"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["a_p2"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["b1"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["test_throws"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ProtectedException"},"tag":"reference","children":["ProtectedException"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["a_p2"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["b1"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["C"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Integer","children":["5"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["5"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["testset"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["write direct child"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"begin","children":["begin"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["a_p2"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.protect"},"tag":"reference","children":["protect"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["makea"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["b1"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Write"},"tag":"reference","children":["Write"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Comment","children":["# protect everything but `b1`"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["test_nowarn"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["a_p2"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["b1"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["test_nowarn"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["a_p2"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["b1"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["B"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["C"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Integer","children":["5"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["5"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["testset"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["write nested"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"begin","children":["begin"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["a_p3"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.protect"},"tag":"reference","children":["protect"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["makea"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["b1"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["c"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["x"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Write"},"tag":"reference","children":["Write"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Comment","children":["# allow mutating only a.b1.c.x"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["test_nowarn"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["a_p3"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["b1"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["c"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["x"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["2"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["test_nowarn"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["a_p3"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["b1"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["c"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["x"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["test"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["a_p3"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["b1"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["c"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"isa","children":["isa"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Protected"},"tag":"reference","children":["Protected"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["test_throws"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ProtectedException"},"tag":"reference","children":["ProtectedException"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["a_p3"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["b1"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["c"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["y"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["2"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file diff --git a/data/FluxTraining@dev/src/callbacks/recorder.jl.json b/data/FluxTraining@dev/src/callbacks/recorder.jl.json index 48c5171e0..ad40559bb 100644 --- a/data/FluxTraining@dev/src/callbacks/recorder.jl.json +++ b/data/FluxTraining@dev/src/callbacks/recorder.jl.json @@ -1 +1 @@ -{"attributes":{"backlinks":[],"path":"/home/runner/.julia/packages/FluxTraining/xCOPx/src/callbacks/recorder.jl","package_id":"FluxTraining@dev","title":"FluxTraining/callbacks/recorder.jl","module_id":"FluxTraining"},"tag":"sourcefile","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["with_kw"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"mutable","children":["mutable"],"type":"node"},{"attributes":{},"tag":"true","children":[""],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.History"},"tag":"reference","children":["History"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Comment","children":["# Number of completed training epochs"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["epochs"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Int"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["0"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Comment","children":["# total number of completed steps"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["steps"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Int"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["0"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Comment","children":["# number of completed steps in current epoch"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["stepsepoch"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Int"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["0"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" Recorder()\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Maintains a [`History`](#). It's stored in `learner.cbstate.history`.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Recorder"},"tag":"reference","children":["Recorder"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Callback"},"tag":"reference","children":["Callback"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.stateaccess"},"tag":"reference","children":["stateaccess"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Recorder"},"tag":"reference","children":["Recorder"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Write"},"tag":"reference","children":["Write"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["step"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Read"},"tag":"reference","children":["Read"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.init!"},"tag":"reference","children":["init!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Recorder"},"tag":"reference","children":["Recorder"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"!","children":["!"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["haskey"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"curly","children":[{"attributes":{},"tag":"Identifier","children":["DefaultDict"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.Phase"},"tag":"reference","children":["Phase"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.History"},"tag":"reference","children":["History"],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"->","children":[{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"->","children":["->"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.History"},"tag":"reference","children":["History"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.on"},"tag":"reference","children":["on"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.EpochBegin"},"tag":"reference","children":["EpochBegin"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.Phase"},"tag":"reference","children":["Phase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["recorder"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Recorder"},"tag":"reference","children":["Recorder"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["stepsepoch"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["0"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.on"},"tag":"reference","children":["on"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.StepEnd"},"tag":"reference","children":["StepEnd"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.Phase"},"tag":"reference","children":["Phase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["recorder"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Recorder"},"tag":"reference","children":["Recorder"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"+=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["steps"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"+=","children":["+="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["1"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"+=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["stepsepoch"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"+=","children":["+="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["1"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.on"},"tag":"reference","children":["on"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.EpochEnd"},"tag":"reference","children":["EpochEnd"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.Phase"},"tag":"reference","children":["Phase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["recorder"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Recorder"},"tag":"reference","children":["Recorder"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"+=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["epochs"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"+=","children":["+="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["1"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file +{"attributes":{"backlinks":[],"path":"/home/runner/.julia/packages/FluxTraining/imTF4/src/callbacks/recorder.jl","package_id":"FluxTraining@dev","title":"FluxTraining/callbacks/recorder.jl","module_id":"FluxTraining"},"tag":"sourcefile","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["with_kw"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"mutable","children":["mutable"],"type":"node"},{"attributes":{},"tag":"true","children":[""],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.History"},"tag":"reference","children":["History"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Comment","children":["# Number of completed training epochs"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["epochs"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Int"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["0"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Comment","children":["# total number of completed steps"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["steps"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Int"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["0"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Comment","children":["# number of completed steps in current epoch"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["stepsepoch"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Int"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["0"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" Recorder()\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Maintains a [`History`](#). It's stored in `learner.cbstate.history`.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Recorder"},"tag":"reference","children":["Recorder"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Callback"},"tag":"reference","children":["Callback"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.stateaccess"},"tag":"reference","children":["stateaccess"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Recorder"},"tag":"reference","children":["Recorder"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Write"},"tag":"reference","children":["Write"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["step"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Read"},"tag":"reference","children":["Read"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.init!"},"tag":"reference","children":["init!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Recorder"},"tag":"reference","children":["Recorder"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"!","children":["!"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["haskey"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"curly","children":[{"attributes":{},"tag":"Identifier","children":["DefaultDict"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.Phase"},"tag":"reference","children":["Phase"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.History"},"tag":"reference","children":["History"],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"->","children":[{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"->","children":["->"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.History"},"tag":"reference","children":["History"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.on"},"tag":"reference","children":["on"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.EpochBegin"},"tag":"reference","children":["EpochBegin"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.Phase"},"tag":"reference","children":["Phase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["recorder"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Recorder"},"tag":"reference","children":["Recorder"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["stepsepoch"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["0"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.on"},"tag":"reference","children":["on"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.StepEnd"},"tag":"reference","children":["StepEnd"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.Phase"},"tag":"reference","children":["Phase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["recorder"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Recorder"},"tag":"reference","children":["Recorder"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"+=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["steps"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"+=","children":["+="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["1"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"+=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["stepsepoch"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"+=","children":["+="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["1"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.on"},"tag":"reference","children":["on"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.EpochEnd"},"tag":"reference","children":["EpochEnd"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.Phase"},"tag":"reference","children":["Phase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["recorder"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Recorder"},"tag":"reference","children":["Recorder"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"+=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["epochs"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"+=","children":["+="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["1"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file diff --git a/data/FluxTraining@dev/src/callbacks/sanitycheck.jl.json b/data/FluxTraining@dev/src/callbacks/sanitycheck.jl.json index 102d48107..ffb12fa2c 100644 --- a/data/FluxTraining@dev/src/callbacks/sanitycheck.jl.json +++ b/data/FluxTraining@dev/src/callbacks/sanitycheck.jl.json @@ -1 +1 @@ -{"attributes":{"backlinks":[],"path":"/home/runner/.julia/packages/FluxTraining/xCOPx/src/callbacks/sanitycheck.jl","package_id":"FluxTraining@dev","title":"FluxTraining/callbacks/sanitycheck.jl","module_id":"FluxTraining"},"tag":"sourcefile","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Check"},"tag":"reference","children":["Check"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["checkfn"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["name"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["throw_error"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Bool"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["message"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.SanityCheckException"},"tag":"reference","children":["SanityCheckException"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Exception"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Base"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["show"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["io"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["IO"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["check"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Check"},"tag":"reference","children":["Check"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["print"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["io"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Check(\\\""],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["check"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["name"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["\\\")"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.runchecks"},"tag":"reference","children":["runchecks"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["checks"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["failed"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["trues"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["length"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["checks"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"for","children":[{"attributes":{},"tag":"for","children":["for"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["i"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["check"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"in","children":["in"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["enumerate"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["checks"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":"Identifier","children":["failed"],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["i"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"!","children":["!"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["check"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["checkfn"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["failedchecks"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":"Identifier","children":["checks"],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["failed"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["isempty"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["failedchecks"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"nothing","children":[""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["println"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"$","children":["$"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["length"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["failedchecks"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"},{"attributes":{},"tag":"String","children":["/"],"type":"node"},{"attributes":{},"tag":"$","children":["$"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["length"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["checks"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"},{"attributes":{},"tag":"String","children":[" sanity checks failed:"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"for","children":[{"attributes":{},"tag":"for","children":["for"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["i"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["check"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"in","children":["in"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["enumerate"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["failedchecks"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["println"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["---"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["println"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["i"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":[": "],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["check"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["name"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":[" ("],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"?","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["check"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["throw_error"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"?","children":["?"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["ERROR"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["WARNING"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":[")"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["println"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["println"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["check"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["message"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["any"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["getfield"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["failedchecks"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["throw_error"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["throw"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.SanityCheckException"},"tag":"reference","children":["SanityCheckException"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" SanityCheck([checks; usedefault = true])\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Callback that runs sanity [`Check`](#)s when the `Learner` is initialized.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["If `usedefault` is `true`, it will run all checks in FluxTraining.CHECKS\n"],"type":"node"},{"attributes":{},"tag":"String","children":["in addition to the ones you pass in.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"mutable","children":["mutable"],"type":"node"},{"attributes":{},"tag":"true","children":[""],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.SanityCheck"},"tag":"reference","children":["SanityCheck"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Callback"},"tag":"reference","children":["Callback"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["checks"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"curly","children":[{"attributes":{},"tag":"Identifier","children":["Vector"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Check"},"tag":"reference","children":["Check"],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["checked"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Bool"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.SanityCheck"},"tag":"reference","children":["SanityCheck"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["checks"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"vect","children":[{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["usedefault"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["isempty"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["checks"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["usedefault"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["checks"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["vcat"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["checks"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.CHECKS"},"tag":"reference","children":["CHECKS"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["new"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["checks"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"false","children":["false"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Base"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["show"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["io"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["IO"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.SanityCheck"},"tag":"reference","children":["SanityCheck"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["print"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["io"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["SanityCheck("],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["length"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["checks"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":[" checks)"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.stateaccess"},"tag":"reference","children":["stateaccess"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.SanityCheck"},"tag":"reference","children":["SanityCheck"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Read"},"tag":"reference","children":["Read"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Read"},"tag":"reference","children":["Read"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["lossfn"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Read"},"tag":"reference","children":["Read"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["optimizer"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Read"},"tag":"reference","children":["Read"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Read"},"tag":"reference","children":["Read"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.on"},"tag":"reference","children":["on"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.EpochBegin"},"tag":"reference","children":["EpochBegin"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.AbstractTrainingPhase"},"tag":"reference","children":["AbstractTrainingPhase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.SanityCheck"},"tag":"reference","children":["SanityCheck"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"!","children":["!"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["checked"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.runchecks"},"tag":"reference","children":["runchecks"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["checks"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["checked"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"true","children":["true"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"p","children":["Checks"],"type":"node"}],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.CheckDataIteratorTrain"},"tag":"reference","children":["CheckDataIteratorTrain"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"do","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Check"},"tag":"reference","children":["Check"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Has training data iterator"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"true","children":["true"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["`learner` training data iterator is `nothing` (not set). You can pass it to\n"],"type":"node"},{"attributes":{},"tag":"String","children":["`Learner` in one of the following ways:\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- `Learner(model, traindataiter, opt, lossfn)`\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- `Learner(model, (traindataiter, valdataiter), opt, lossfn)`\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- `Learner(model, (training = traindataiter,), opt, lossfn)`\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"do","children":["do"],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"!","children":["!"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["isnothing"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["training"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.CheckDataIteratorValid"},"tag":"reference","children":["CheckDataIteratorValid"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"do","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Check"},"tag":"reference","children":["Check"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Has validation data iterator"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"false","children":["false"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["`learner` validation data iterator is `nothing` (not set).\n"],"type":"node"},{"attributes":{},"tag":"String","children":["It is not mandatory, but you must set it to fit `ValidationPhase`s.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["You can pass it to `Learner` like this:\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- `Learner(model, (traindataiter, valdataiter), opt, lossfn)`\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Or if you want to use training data as validation data:\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- `Learner(model, (traindataiter, traindataiter), opt, lossfn)`\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"do","children":["do"],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"!","children":["!"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["isnothing"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["validation"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.CheckIteratesTuples"},"tag":"reference","children":["CheckIteratesTuples"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"do","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Check"},"tag":"reference","children":["Check"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Data iterators iterate over tuples"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"true","children":["true"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Data iterators need to be iterable and return tuples.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["This means that `for (x, y) in dataiter end` works where\n"],"type":"node"},{"attributes":{},"tag":"String","children":["`(x, y)` is a pair of model inputs and outputs.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"do","children":["do"],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"try","children":[{"attributes":{},"tag":"try","children":["try"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"Identifier","children":["batch"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["_"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Base"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["iterate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["training"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"Identifier","children":["x"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["y"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["batch"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"catch","children":["catch"],"type":"node"},{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"false","children":["false"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"true","children":["true"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.CheckModelLossStep"},"tag":"reference","children":["CheckModelLossStep"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"do","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Check"},"tag":"reference","children":["Check"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Model and loss function compatible with data"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"true","children":["true"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["To perform the optimization step, the model and loss function need\n"],"type":"node"},{"attributes":{},"tag":"String","children":["to be compatible with the data. This means the following must work:\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- `(x, y), _ = iterate(learner.data.training)`\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- `ŷ = learner.model(x)`\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- `loss = learner.lossfn(ŷ, y)`\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"do","children":["do"],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"try","children":[{"attributes":{},"tag":"try","children":["try"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["dev"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"?","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ToGPU"},"tag":"reference","children":["ToGPU"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"in","children":["in"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbs"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"?","children":["?"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["gpu"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["identity"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"Identifier","children":["x"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["y"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["dev"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["iterate"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["training"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Integer","children":["1"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["ŷ"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["dev"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["x"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["assert"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["lossfn"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ŷ"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["y"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"isa","children":["isa"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Number"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"catch","children":["catch"],"type":"node"},{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"false","children":["false"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"true","children":["true"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"const","children":[{"attributes":{},"tag":"const","children":["const"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.CHECKS"},"tag":"reference","children":["CHECKS"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"vect","children":[{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.CheckDataIteratorTrain"},"tag":"reference","children":["CheckDataIteratorTrain"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.CheckDataIteratorValid"},"tag":"reference","children":["CheckDataIteratorValid"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.CheckIteratesTuples"},"tag":"reference","children":["CheckIteratesTuples"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.CheckModelLossStep"},"tag":"reference","children":["CheckModelLossStep"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file +{"attributes":{"backlinks":[],"path":"/home/runner/.julia/packages/FluxTraining/imTF4/src/callbacks/sanitycheck.jl","package_id":"FluxTraining@dev","title":"FluxTraining/callbacks/sanitycheck.jl","module_id":"FluxTraining"},"tag":"sourcefile","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Check"},"tag":"reference","children":["Check"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["checkfn"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["name"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["throw_error"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Bool"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["message"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.SanityCheckException"},"tag":"reference","children":["SanityCheckException"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Exception"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Base"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["show"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["io"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["IO"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["check"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Check"},"tag":"reference","children":["Check"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["print"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["io"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Check(\\\""],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["check"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["name"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["\\\")"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.runchecks"},"tag":"reference","children":["runchecks"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["checks"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["failed"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["trues"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["length"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["checks"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"for","children":[{"attributes":{},"tag":"for","children":["for"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["i"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["check"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"in","children":["in"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["enumerate"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["checks"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":"Identifier","children":["failed"],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["i"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"!","children":["!"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["check"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["checkfn"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["failedchecks"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":"Identifier","children":["checks"],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["failed"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["isempty"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["failedchecks"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"nothing","children":[""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["println"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"$","children":["$"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["length"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["failedchecks"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"},{"attributes":{},"tag":"String","children":["/"],"type":"node"},{"attributes":{},"tag":"$","children":["$"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["length"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["checks"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"},{"attributes":{},"tag":"String","children":[" sanity checks failed:"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"for","children":[{"attributes":{},"tag":"for","children":["for"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["i"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["check"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"in","children":["in"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["enumerate"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["failedchecks"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["println"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["---"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["println"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["i"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":[": "],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["check"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["name"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":[" ("],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"?","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["check"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["throw_error"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"?","children":["?"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["ERROR"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["WARNING"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":[")"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["println"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["println"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["check"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["message"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["any"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["getfield"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["failedchecks"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["throw_error"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["throw"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.SanityCheckException"},"tag":"reference","children":["SanityCheckException"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" SanityCheck([checks; usedefault = true])\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Callback that runs sanity [`Check`](#)s when the `Learner` is initialized.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["If `usedefault` is `true`, it will run all checks in FluxTraining.CHECKS\n"],"type":"node"},{"attributes":{},"tag":"String","children":["in addition to the ones you pass in.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"mutable","children":["mutable"],"type":"node"},{"attributes":{},"tag":"true","children":[""],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.SanityCheck"},"tag":"reference","children":["SanityCheck"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Callback"},"tag":"reference","children":["Callback"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["checks"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"curly","children":[{"attributes":{},"tag":"Identifier","children":["Vector"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Check"},"tag":"reference","children":["Check"],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["checked"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Bool"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.SanityCheck"},"tag":"reference","children":["SanityCheck"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["checks"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"vect","children":[{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["usedefault"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["isempty"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["checks"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["usedefault"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["checks"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["vcat"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["checks"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.CHECKS"},"tag":"reference","children":["CHECKS"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["new"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["checks"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"false","children":["false"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Base"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["show"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["io"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["IO"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.SanityCheck"},"tag":"reference","children":["SanityCheck"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["print"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["io"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["SanityCheck("],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["length"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["checks"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":[" checks)"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.stateaccess"},"tag":"reference","children":["stateaccess"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.SanityCheck"},"tag":"reference","children":["SanityCheck"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Read"},"tag":"reference","children":["Read"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Read"},"tag":"reference","children":["Read"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["lossfn"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Read"},"tag":"reference","children":["Read"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["optimizer"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Read"},"tag":"reference","children":["Read"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Read"},"tag":"reference","children":["Read"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.on"},"tag":"reference","children":["on"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.EpochBegin"},"tag":"reference","children":["EpochBegin"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.AbstractTrainingPhase"},"tag":"reference","children":["AbstractTrainingPhase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.SanityCheck"},"tag":"reference","children":["SanityCheck"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"!","children":["!"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["checked"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.runchecks"},"tag":"reference","children":["runchecks"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["checks"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["checked"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"true","children":["true"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"p","children":["Checks"],"type":"node"}],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.CheckDataIteratorTrain"},"tag":"reference","children":["CheckDataIteratorTrain"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"do","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Check"},"tag":"reference","children":["Check"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Has training data iterator"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"true","children":["true"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["`learner` training data iterator is `nothing` (not set). You can pass it to\n"],"type":"node"},{"attributes":{},"tag":"String","children":["`Learner` in one of the following ways:\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- `Learner(model, traindataiter, opt, lossfn)`\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- `Learner(model, (traindataiter, valdataiter), opt, lossfn)`\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- `Learner(model, (training = traindataiter,), opt, lossfn)`\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"do","children":["do"],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"!","children":["!"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["isnothing"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["training"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.CheckDataIteratorValid"},"tag":"reference","children":["CheckDataIteratorValid"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"do","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Check"},"tag":"reference","children":["Check"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Has validation data iterator"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"false","children":["false"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["`learner` validation data iterator is `nothing` (not set).\n"],"type":"node"},{"attributes":{},"tag":"String","children":["It is not mandatory, but you must set it to fit `ValidationPhase`s.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["You can pass it to `Learner` like this:\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- `Learner(model, (traindataiter, valdataiter), opt, lossfn)`\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Or if you want to use training data as validation data:\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- `Learner(model, (traindataiter, traindataiter), opt, lossfn)`\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"do","children":["do"],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"!","children":["!"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["isnothing"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["validation"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.CheckIteratesTuples"},"tag":"reference","children":["CheckIteratesTuples"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"do","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Check"},"tag":"reference","children":["Check"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Data iterators iterate over tuples"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"true","children":["true"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Data iterators need to be iterable and return tuples.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["This means that `for (x, y) in dataiter end` works where\n"],"type":"node"},{"attributes":{},"tag":"String","children":["`(x, y)` is a pair of model inputs and outputs.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"do","children":["do"],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"try","children":[{"attributes":{},"tag":"try","children":["try"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"Identifier","children":["batch"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["_"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Base"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["iterate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["training"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"Identifier","children":["x"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["y"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["batch"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"catch","children":["catch"],"type":"node"},{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"false","children":["false"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"true","children":["true"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.CheckModelLossStep"},"tag":"reference","children":["CheckModelLossStep"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"do","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Check"},"tag":"reference","children":["Check"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Model and loss function compatible with data"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"true","children":["true"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["To perform the optimization step, the model and loss function need\n"],"type":"node"},{"attributes":{},"tag":"String","children":["to be compatible with the data. This means the following must work:\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- `(x, y), _ = iterate(learner.data.training)`\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- `ŷ = learner.model(x)`\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- `loss = learner.lossfn(ŷ, y)`\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"do","children":["do"],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"try","children":[{"attributes":{},"tag":"try","children":["try"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["dev"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"?","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ToGPU"},"tag":"reference","children":["ToGPU"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"in","children":["in"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbs"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"?","children":["?"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["gpu"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["identity"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"Identifier","children":["x"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["y"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["dev"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["iterate"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["training"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Integer","children":["1"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["ŷ"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["dev"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["x"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["assert"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["lossfn"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ŷ"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["y"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"isa","children":["isa"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Number"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"catch","children":["catch"],"type":"node"},{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"false","children":["false"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"true","children":["true"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"const","children":[{"attributes":{},"tag":"const","children":["const"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.CHECKS"},"tag":"reference","children":["CHECKS"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"vect","children":[{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.CheckDataIteratorTrain"},"tag":"reference","children":["CheckDataIteratorTrain"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.CheckDataIteratorValid"},"tag":"reference","children":["CheckDataIteratorValid"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.CheckIteratesTuples"},"tag":"reference","children":["CheckIteratesTuples"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.CheckModelLossStep"},"tag":"reference","children":["CheckModelLossStep"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file diff --git a/data/FluxTraining@dev/src/callbacks/scheduler.jl.json b/data/FluxTraining@dev/src/callbacks/scheduler.jl.json index 3ec23b5f8..690d22092 100644 --- a/data/FluxTraining@dev/src/callbacks/scheduler.jl.json +++ b/data/FluxTraining@dev/src/callbacks/scheduler.jl.json @@ -1 +1 @@ -{"attributes":{"backlinks":[],"path":"/home/runner/.julia/packages/FluxTraining/xCOPx/src/callbacks/scheduler.jl","package_id":"FluxTraining@dev","title":"FluxTraining/callbacks/scheduler.jl","module_id":"FluxTraining"},"tag":"sourcefile","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" Scheduler(schedules...)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Callback for hyperparameter scheduling. Takes pairs of [`HyperParameter`](#)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["types and [ParameterSchedulers.jl schedules](https://github.com/FluxML/ParameterSchedulers.jl).\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["See [the tutorial](/docs/docs/tutorials/hyperparameters.md) for more information.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["## Example\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["```julia\n"],"type":"node"},{"attributes":{},"tag":"String","children":["es = length(learner.data.training)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["lrschedule = ParameterSchedulers.Step(;λ=1.0, γ=0.9, step_sizes=[10, 20])\n"],"type":"node"},{"attributes":{},"tag":"String","children":["scheduler = Scheduler(\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" LearningRate => lrschedule\n"],"type":"node"},{"attributes":{},"tag":"String","children":[")\n"],"type":"node"},{"attributes":{},"tag":"String","children":["```\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"mutable","children":["mutable"],"type":"node"},{"attributes":{},"tag":"true","children":[""],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Scheduler"},"tag":"reference","children":["Scheduler"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Callback"},"tag":"reference","children":["Callback"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["schedules"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"curly","children":[{"attributes":{},"tag":"Identifier","children":["Dict"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{},"tag":"curly","children":[{"attributes":{},"tag":"Identifier","children":["Type"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.HyperParameter"},"tag":"reference","children":["HyperParameter"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["ParameterSchedulers"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["AbstractSchedule"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["step"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Int"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Scheduler"},"tag":"reference","children":["Scheduler"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"...","children":[{"attributes":{},"tag":"Identifier","children":["args"],"type":"node"},{"attributes":{},"tag":"...","children":["..."],"type":"node"}],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"...","children":[{"attributes":{},"tag":"Identifier","children":["kwargs"],"type":"node"},{"attributes":{},"tag":"...","children":["..."],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["new"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["Dict"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"...","children":[{"attributes":{},"tag":"Identifier","children":["args"],"type":"node"},{"attributes":{},"tag":"...","children":["..."],"type":"node"}],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"...","children":[{"attributes":{},"tag":"Identifier","children":["kwargs"],"type":"node"},{"attributes":{},"tag":"...","children":["..."],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["1"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Base"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["show"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["io"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["IO"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["scheduler"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Scheduler"},"tag":"reference","children":["Scheduler"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["print"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["io"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Scheduler("],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["join"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["keys"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["scheduler"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["schedules"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":[", "],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":[")"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.stateaccess"},"tag":"reference","children":["stateaccess"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["scheduler"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Scheduler"},"tag":"reference","children":["Scheduler"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Comment","children":["# TODO: implement proper merging of permissions"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["length"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["keys"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["scheduler"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["schedules"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"==","children":["=="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["0"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["hpstateaccess"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"else","children":["else"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["hpstateaccess"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["merge"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"...","children":[{"attributes":{},"tag":".","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.stateaccess"},"tag":"reference","children":["stateaccess"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["keys"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["scheduler"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["schedules"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"...","children":["..."],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Read"},"tag":"reference","children":["Read"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["hyperparams"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Write"},"tag":"reference","children":["Write"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Read"},"tag":"reference","children":["Read"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"...","children":[{"attributes":{},"tag":"Identifier","children":["hpstateaccess"],"type":"node"},{"attributes":{},"tag":"...","children":["..."],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.resolveconflict"},"tag":"reference","children":["resolveconflict"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Scheduler"},"tag":"reference","children":["Scheduler"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["to"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ToDevice"},"tag":"reference","children":["ToDevice"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.RunFirst"},"tag":"reference","children":["RunFirst"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["to"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.init!"},"tag":"reference","children":["init!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["scheduler"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Scheduler"},"tag":"reference","children":["Scheduler"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"!","children":["!"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["haskey"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["hyperparams"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["hyperparams"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["MVHistory"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["scheduler"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["step"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["1"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.on"},"tag":"reference","children":["on"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.StepBegin"},"tag":"reference","children":["StepBegin"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.AbstractTrainingPhase"},"tag":"reference","children":["AbstractTrainingPhase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["scheduler"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Scheduler"},"tag":"reference","children":["Scheduler"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["step"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["scheduler"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["step"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"for","children":[{"attributes":{},"tag":"for","children":["for"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["H"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["schedule"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"in","children":["in"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["scheduler"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["schedules"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["value"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["schedule"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["step"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.sethyperparameter!"},"tag":"reference","children":["sethyperparameter!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["H"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["value"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["push!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["hyperparams"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["Symbol"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["H"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["steps"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["value"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"+=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["scheduler"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["step"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"+=","children":["+="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["1"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" onecycle(nsteps, max_val, [start_val, end_val; pct_start])\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Creates a one-cycle [`Schedule`](#) over `nsteps` steps from `start_val`\n"],"type":"node"},{"attributes":{},"tag":"String","children":["over `max_val` to `end_val`.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["## Examples\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["```julia\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["epochlength = length(traindataiter)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["cb = Scheduler(LearningRate => onecycle(10epochlength, 0.01))\n"],"type":"node"},{"attributes":{},"tag":"String","children":["learner = Learner(...; callbacks=[cb])\n"],"type":"node"},{"attributes":{},"tag":"String","children":["```\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.onecycle"},"tag":"reference","children":["onecycle"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["nsteps"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["max_val"],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["pct_start"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Float","children":["0.25"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["div"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Integer","children":["25"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["divfinal"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Float","children":["1e5"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["start_val"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["max_val"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"/","children":["/"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["div"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["end_val"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["max_val"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"/","children":["/"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["divfinal"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["warmup"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["ceil"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Int"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["nsteps"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"*","children":["*"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["pct_start"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["warmdown"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["nsteps"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"-","children":["-"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["warmup"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["Sequence"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["Sin"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["λ0"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Identifier","children":["max_val"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["λ1"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Identifier","children":["start_val"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["period"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Integer","children":["2"],"type":"node"},{"attributes":{},"tag":"*","children":["*"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["warmup"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=>","children":["=>"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["warmup"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["Shifted"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["Sin"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["λ0"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Identifier","children":["max_val"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["λ1"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Identifier","children":["end_val"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["period"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Integer","children":["2"],"type":"node"},{"attributes":{},"tag":"*","children":["*"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["warmdown"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["warmdown"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"+","children":["+"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["1"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=>","children":["=>"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["warmdown"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file +{"attributes":{"backlinks":[],"path":"/home/runner/.julia/packages/FluxTraining/imTF4/src/callbacks/scheduler.jl","package_id":"FluxTraining@dev","title":"FluxTraining/callbacks/scheduler.jl","module_id":"FluxTraining"},"tag":"sourcefile","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" Scheduler(schedules...)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Callback for hyperparameter scheduling. Takes pairs of [`HyperParameter`](#)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["types and [ParameterSchedulers.jl schedules](https://github.com/FluxML/ParameterSchedulers.jl).\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["See [the tutorial](/docs/docs/tutorials/hyperparameters.md) for more information.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["## Example\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["```julia\n"],"type":"node"},{"attributes":{},"tag":"String","children":["es = length(learner.data.training)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["lrschedule = ParameterSchedulers.Step(;λ=1.0, γ=0.9, step_sizes=[10, 20])\n"],"type":"node"},{"attributes":{},"tag":"String","children":["scheduler = Scheduler(\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" LearningRate => lrschedule\n"],"type":"node"},{"attributes":{},"tag":"String","children":[")\n"],"type":"node"},{"attributes":{},"tag":"String","children":["```\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"mutable","children":["mutable"],"type":"node"},{"attributes":{},"tag":"true","children":[""],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Scheduler"},"tag":"reference","children":["Scheduler"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Callback"},"tag":"reference","children":["Callback"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["schedules"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"curly","children":[{"attributes":{},"tag":"Identifier","children":["Dict"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{},"tag":"curly","children":[{"attributes":{},"tag":"Identifier","children":["Type"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.HyperParameter"},"tag":"reference","children":["HyperParameter"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["ParameterSchedulers"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["AbstractSchedule"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["step"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Int"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Scheduler"},"tag":"reference","children":["Scheduler"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"...","children":[{"attributes":{},"tag":"Identifier","children":["args"],"type":"node"},{"attributes":{},"tag":"...","children":["..."],"type":"node"}],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"...","children":[{"attributes":{},"tag":"Identifier","children":["kwargs"],"type":"node"},{"attributes":{},"tag":"...","children":["..."],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["new"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["Dict"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"...","children":[{"attributes":{},"tag":"Identifier","children":["args"],"type":"node"},{"attributes":{},"tag":"...","children":["..."],"type":"node"}],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"...","children":[{"attributes":{},"tag":"Identifier","children":["kwargs"],"type":"node"},{"attributes":{},"tag":"...","children":["..."],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["1"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Base"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["show"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["io"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["IO"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["scheduler"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Scheduler"},"tag":"reference","children":["Scheduler"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["print"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["io"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Scheduler("],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["join"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["keys"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["scheduler"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["schedules"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":[", "],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":[")"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.stateaccess"},"tag":"reference","children":["stateaccess"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["scheduler"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Scheduler"},"tag":"reference","children":["Scheduler"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Comment","children":["# TODO: implement proper merging of permissions"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["length"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["keys"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["scheduler"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["schedules"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"==","children":["=="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["0"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["hpstateaccess"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"else","children":["else"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["hpstateaccess"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["merge"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"...","children":[{"attributes":{},"tag":".","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.stateaccess"},"tag":"reference","children":["stateaccess"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["keys"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["scheduler"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["schedules"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"...","children":["..."],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Read"},"tag":"reference","children":["Read"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["hyperparams"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Write"},"tag":"reference","children":["Write"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Read"},"tag":"reference","children":["Read"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"...","children":[{"attributes":{},"tag":"Identifier","children":["hpstateaccess"],"type":"node"},{"attributes":{},"tag":"...","children":["..."],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.resolveconflict"},"tag":"reference","children":["resolveconflict"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Scheduler"},"tag":"reference","children":["Scheduler"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["to"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ToDevice"},"tag":"reference","children":["ToDevice"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.RunFirst"},"tag":"reference","children":["RunFirst"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["to"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.init!"},"tag":"reference","children":["init!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["scheduler"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Scheduler"},"tag":"reference","children":["Scheduler"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"!","children":["!"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["haskey"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["hyperparams"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["hyperparams"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["MVHistory"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["scheduler"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["step"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["1"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.on"},"tag":"reference","children":["on"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.StepBegin"},"tag":"reference","children":["StepBegin"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.AbstractTrainingPhase"},"tag":"reference","children":["AbstractTrainingPhase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["scheduler"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Scheduler"},"tag":"reference","children":["Scheduler"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["step"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["scheduler"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["step"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"for","children":[{"attributes":{},"tag":"for","children":["for"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["H"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["schedule"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"in","children":["in"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["scheduler"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["schedules"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["value"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["schedule"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["step"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.sethyperparameter!"},"tag":"reference","children":["sethyperparameter!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["H"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["value"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["push!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["hyperparams"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["Symbol"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["H"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["steps"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["value"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"+=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["scheduler"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["step"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"+=","children":["+="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["1"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" onecycle(nsteps, max_val, [start_val, end_val; pct_start])\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Creates a one-cycle [`Schedule`](#) over `nsteps` steps from `start_val`\n"],"type":"node"},{"attributes":{},"tag":"String","children":["over `max_val` to `end_val`.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["## Examples\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["```julia\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["epochlength = length(traindataiter)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["cb = Scheduler(LearningRate => onecycle(10epochlength, 0.01))\n"],"type":"node"},{"attributes":{},"tag":"String","children":["learner = Learner(...; callbacks=[cb])\n"],"type":"node"},{"attributes":{},"tag":"String","children":["```\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.onecycle"},"tag":"reference","children":["onecycle"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["nsteps"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["max_val"],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["pct_start"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Float","children":["0.25"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["div"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Integer","children":["25"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["divfinal"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Float","children":["1e5"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["start_val"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["max_val"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"/","children":["/"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["div"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["end_val"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["max_val"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"/","children":["/"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["divfinal"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["warmup"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["ceil"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Int"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["nsteps"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"*","children":["*"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["pct_start"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["warmdown"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["nsteps"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"-","children":["-"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["warmup"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["Sequence"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["Sin"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["λ0"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Identifier","children":["max_val"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["λ1"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Identifier","children":["start_val"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["period"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Integer","children":["2"],"type":"node"},{"attributes":{},"tag":"*","children":["*"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["warmup"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=>","children":["=>"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["warmup"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["Shifted"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["Sin"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["λ0"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Identifier","children":["max_val"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["λ1"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Identifier","children":["end_val"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["period"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Integer","children":["2"],"type":"node"},{"attributes":{},"tag":"*","children":["*"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["warmdown"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["warmdown"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"+","children":["+"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["1"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=>","children":["=>"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["warmdown"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file diff --git a/data/FluxTraining@dev/src/callbacks/trace.jl.json b/data/FluxTraining@dev/src/callbacks/trace.jl.json index 452b191cb..a218dc19a 100644 --- a/data/FluxTraining@dev/src/callbacks/trace.jl.json +++ b/data/FluxTraining@dev/src/callbacks/trace.jl.json @@ -1 +1 @@ -{"attributes":{"backlinks":[],"path":"/home/runner/.julia/packages/FluxTraining/xCOPx/src/callbacks/trace.jl","package_id":"FluxTraining@dev","title":"FluxTraining/callbacks/trace.jl","module_id":"FluxTraining"},"tag":"sourcefile","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" Traces(preprocess[, phase])\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Record a trace during `phase` by apply each pre-processing function in\n"],"type":"node"},{"attributes":{},"tag":"String","children":["`preprocess` to the [`Learner`](#) to produce a trace value.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["The trace is recorded at the end of each learning step.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["See [`LogTraces`](#) for logging of the trace values.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["```julia\n"],"type":"node"},{"attributes":{},"tag":"String","children":["cb = Traces((loss2 = learner -> learner.step.loss^2,\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" avg_gnorm = learner -> mean(map((_, g) -> norm(g), pairs(learner.step.grads))))\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" TrainingPhase)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["```\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"curly","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Traces"},"tag":"reference","children":["Traces"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Identifier","children":["P"],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.Phase"},"tag":"reference","children":["Phase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Callback"},"tag":"reference","children":["Callback"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["preprocess"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["NamedTuple"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Traces"},"tag":"reference","children":["Traces"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["preprocess"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["NamedTuple"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["P"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"curly","children":[{"attributes":{},"tag":"Identifier","children":["Type"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.Phase"},"tag":"reference","children":["Phase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.Phase"},"tag":"reference","children":["Phase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"curly","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Traces"},"tag":"reference","children":["Traces"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["P"],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["preprocess"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.stateaccess"},"tag":"reference","children":["stateaccess"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Traces"},"tag":"reference","children":["Traces"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Read"},"tag":"reference","children":["Read"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["tracehistory"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Write"},"tag":"reference","children":["Write"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["step"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Read"},"tag":"reference","children":["Read"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.init!"},"tag":"reference","children":["init!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["traces"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Traces"},"tag":"reference","children":["Traces"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"||","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["length"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["traces"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["preprocess"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"==","children":["=="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["length"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["unique"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["keys"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["traces"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["preprocess"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"||","children":["||"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["error"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Multiple traces have the same name!"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"!","children":["!"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["haskey"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["tracehistory"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["tracehistory"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"curly","children":[{"attributes":{},"tag":"Identifier","children":["DefaultDict"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.Phase"},"tag":"reference","children":["Phase"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Identifier","children":["MVHistory"],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"->","children":[{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"->","children":["->"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["MVHistory"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"where","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.on"},"tag":"reference","children":["on"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.StepEnd"},"tag":"reference","children":["StepEnd"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["P"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["traces"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"curly","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Traces"},"tag":"reference","children":["Traces"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["P"],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"where","children":["where"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Identifier","children":["P"],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.Phase"},"tag":"reference","children":["Phase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["step"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["steps"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["tracehistory"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"for","children":[{"attributes":{},"tag":"for","children":["for"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["trace_name"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["f"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"in","children":["in"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["pairs"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["traces"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["preprocess"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["val"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["f"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["push!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["trace_name"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["step"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["val"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["testset"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Traces"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"begin","children":["begin"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Traces"},"tag":"reference","children":["Traces"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["keya"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"->","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"->","children":["->"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["sum"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["step"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["ys"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["keyb"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"->","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"->","children":["->"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["sum"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["step"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["ŷs"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.ValidationPhase"},"tag":"reference","children":["ValidationPhase"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.testlearner"},"tag":"reference","children":["testlearner"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Recorder"},"tag":"reference","children":["Recorder"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["test_nowarn"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.fit!"},"tag":"reference","children":["fit!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["1"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["test"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["keya"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"∈","children":["∈"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["keys"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["tracehistory"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.ValidationPhase"},"tag":"reference","children":["ValidationPhase"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["test"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["keyb"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"∈","children":["∈"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["keys"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["tracehistory"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.ValidationPhase"},"tag":"reference","children":["ValidationPhase"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["test"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["keya"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"∉","children":["∉"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["keys"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["tracehistory"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.TrainingPhase"},"tag":"reference","children":["TrainingPhase"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["test"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["keyb"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"∉","children":["∉"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["keys"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["tracehistory"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.TrainingPhase"},"tag":"reference","children":["TrainingPhase"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file +{"attributes":{"backlinks":[],"path":"/home/runner/.julia/packages/FluxTraining/imTF4/src/callbacks/trace.jl","package_id":"FluxTraining@dev","title":"FluxTraining/callbacks/trace.jl","module_id":"FluxTraining"},"tag":"sourcefile","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" Traces(preprocess[, phase])\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Record a trace during `phase` by apply each pre-processing function in\n"],"type":"node"},{"attributes":{},"tag":"String","children":["`preprocess` to the [`Learner`](#) to produce a trace value.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["The trace is recorded at the end of each learning step.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["See [`LogTraces`](#) for logging of the trace values.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["```julia\n"],"type":"node"},{"attributes":{},"tag":"String","children":["cb = Traces((loss2 = learner -> learner.step.loss^2,\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" avg_gnorm = learner -> mean(map((_, g) -> norm(g), pairs(learner.step.grads))))\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" TrainingPhase)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["```\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"curly","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Traces"},"tag":"reference","children":["Traces"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Identifier","children":["P"],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.Phase"},"tag":"reference","children":["Phase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Callback"},"tag":"reference","children":["Callback"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["preprocess"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["NamedTuple"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Traces"},"tag":"reference","children":["Traces"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["preprocess"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["NamedTuple"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["P"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"curly","children":[{"attributes":{},"tag":"Identifier","children":["Type"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.Phase"},"tag":"reference","children":["Phase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.Phase"},"tag":"reference","children":["Phase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"curly","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Traces"},"tag":"reference","children":["Traces"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["P"],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["preprocess"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.stateaccess"},"tag":"reference","children":["stateaccess"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Traces"},"tag":"reference","children":["Traces"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Read"},"tag":"reference","children":["Read"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["tracehistory"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Write"},"tag":"reference","children":["Write"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["step"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Read"},"tag":"reference","children":["Read"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.init!"},"tag":"reference","children":["init!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["traces"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Traces"},"tag":"reference","children":["Traces"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"||","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["length"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["traces"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["preprocess"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"==","children":["=="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["length"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["unique"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["keys"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["traces"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["preprocess"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"||","children":["||"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["error"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Multiple traces have the same name!"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"!","children":["!"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["haskey"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["tracehistory"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["tracehistory"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"curly","children":[{"attributes":{},"tag":"Identifier","children":["DefaultDict"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.Phase"},"tag":"reference","children":["Phase"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Identifier","children":["MVHistory"],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"->","children":[{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"->","children":["->"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["MVHistory"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"where","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.on"},"tag":"reference","children":["on"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.StepEnd"},"tag":"reference","children":["StepEnd"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["P"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["traces"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"curly","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Traces"},"tag":"reference","children":["Traces"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["P"],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"where","children":["where"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Identifier","children":["P"],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.Phase"},"tag":"reference","children":["Phase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["step"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["steps"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["tracehistory"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"for","children":[{"attributes":{},"tag":"for","children":["for"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["trace_name"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["f"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"in","children":["in"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["pairs"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["traces"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["preprocess"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["val"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["f"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["push!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["history"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["trace_name"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["step"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["val"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["testset"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Traces"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"begin","children":["begin"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Traces"},"tag":"reference","children":["Traces"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["keya"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"->","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"->","children":["->"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["sum"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["step"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["ys"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["keyb"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"->","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"->","children":["->"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["sum"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["step"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["ŷs"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.ValidationPhase"},"tag":"reference","children":["ValidationPhase"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.testlearner"},"tag":"reference","children":["testlearner"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Recorder"},"tag":"reference","children":["Recorder"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["test_nowarn"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.fit!"},"tag":"reference","children":["fit!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["1"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["test"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["keya"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"∈","children":["∈"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["keys"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["tracehistory"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.ValidationPhase"},"tag":"reference","children":["ValidationPhase"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["test"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["keyb"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"∈","children":["∈"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["keys"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["tracehistory"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.ValidationPhase"},"tag":"reference","children":["ValidationPhase"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["test"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["keya"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"∉","children":["∉"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["keys"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["tracehistory"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.TrainingPhase"},"tag":"reference","children":["TrainingPhase"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["test"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["keyb"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"∉","children":["∉"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["keys"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["tracehistory"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.TrainingPhase"},"tag":"reference","children":["TrainingPhase"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file diff --git a/data/FluxTraining@dev/src/callbackutils.jl.json b/data/FluxTraining@dev/src/callbackutils.jl.json index 675b69866..8adfde13c 100644 --- a/data/FluxTraining@dev/src/callbackutils.jl.json +++ b/data/FluxTraining@dev/src/callbackutils.jl.json @@ -1 +1 @@ -{"attributes":{"backlinks":[],"path":"/home/runner/.julia/packages/FluxTraining/xCOPx/src/callbackutils.jl","package_id":"FluxTraining@dev","title":"FluxTraining/callbackutils.jl","module_id":"FluxTraining"},"tag":"sourcefile","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" setcallbacks!(learner, callbacks)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Set `learner`'s callbacks to `callbacks`, removing all current callbacks.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.setcallbacks!"},"tag":"reference","children":["setcallbacks!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Callbacks"},"tag":"reference","children":["Callbacks"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" addcallback!(learner, callback)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Adds `callback` to `learner` and updates the dependency graph.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.addcallback!"},"tag":"reference","children":["addcallback!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["callback"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.AbstractCallback"},"tag":"reference","children":["AbstractCallback"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Callbacks"},"tag":"reference","children":["Callbacks"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["vcat"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbs"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["callback"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.init!"},"tag":"reference","children":["init!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["callback"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"nothing","children":[""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" getcallback(learner, C)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Find callback of type `C` in `learner`'s callbacks and return it.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["If there is none, return `nothing`.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.getcallback"},"tag":"reference","children":["getcallback"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["C"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"curly","children":[{"attributes":{},"tag":"Identifier","children":["Type"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["FluxTraining"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Callback"},"tag":"reference","children":["Callback"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["cbidx"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["findfirst"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["isa"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbs"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["C"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"?","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["isnothing"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cbidx"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"?","children":["?"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["nothing"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbs"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cbidx"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" replacecallback!(learner, callback::C)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Replace existing callback of type `C` on learner with `callback`.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Return the replaced callback.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["If `learner` doesn't have a callback of type `C`, add `callback` and\n"],"type":"node"},{"attributes":{},"tag":"String","children":["return `nothing`.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"where","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.replacecallback!"},"tag":"reference","children":["replacecallback!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["callback"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["C"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"where","children":["where"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Identifier","children":["C"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["FluxTraining"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Callback"},"tag":"reference","children":["Callback"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["cbidx"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["findfirst"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["isa"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbs"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["C"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["isnothing"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cbidx"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["FluxTraining"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.addcallback!"},"tag":"reference","children":["addcallback!"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["callback"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["nothing"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"else","children":["else"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["oldcb"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbs"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cbidx"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbs"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cbidx"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["callback"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["FluxTraining"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.setcallbacks!"},"tag":"reference","children":["setcallbacks!"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbs"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["oldcb"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" removecallback!(learner, C)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Remove the first callback of type `C` from `learner` and return it.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["If there is none, return `nothing`.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.removecallback!"},"tag":"reference","children":["removecallback!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["C"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"curly","children":[{"attributes":{},"tag":"Identifier","children":["Type"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["FluxTraining"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Callback"},"tag":"reference","children":["Callback"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["cbidx"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["findfirst"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["isa"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbs"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["C"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["isnothing"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cbidx"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["nothing"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["popat!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbs"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cbidx"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Callbacks"},"tag":"reference","children":["Callbacks"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbs"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file +{"attributes":{"backlinks":[],"path":"/home/runner/.julia/packages/FluxTraining/imTF4/src/callbackutils.jl","package_id":"FluxTraining@dev","title":"FluxTraining/callbackutils.jl","module_id":"FluxTraining"},"tag":"sourcefile","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" setcallbacks!(learner, callbacks)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Set `learner`'s callbacks to `callbacks`, removing all current callbacks.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.setcallbacks!"},"tag":"reference","children":["setcallbacks!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Callbacks"},"tag":"reference","children":["Callbacks"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" addcallback!(learner, callback)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Adds `callback` to `learner` and updates the dependency graph.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.addcallback!"},"tag":"reference","children":["addcallback!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["callback"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.AbstractCallback"},"tag":"reference","children":["AbstractCallback"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Callbacks"},"tag":"reference","children":["Callbacks"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["vcat"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbs"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["callback"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.init!"},"tag":"reference","children":["init!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["callback"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"nothing","children":[""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" getcallback(learner, C)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Find callback of type `C` in `learner`'s callbacks and return it.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["If there is none, return `nothing`.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.getcallback"},"tag":"reference","children":["getcallback"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["C"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"curly","children":[{"attributes":{},"tag":"Identifier","children":["Type"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["FluxTraining"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Callback"},"tag":"reference","children":["Callback"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["cbidx"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["findfirst"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["isa"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbs"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["C"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"?","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["isnothing"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cbidx"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"?","children":["?"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["nothing"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbs"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cbidx"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" replacecallback!(learner, callback::C)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Replace existing callback of type `C` on learner with `callback`.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Return the replaced callback.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["If `learner` doesn't have a callback of type `C`, add `callback` and\n"],"type":"node"},{"attributes":{},"tag":"String","children":["return `nothing`.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"where","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.replacecallback!"},"tag":"reference","children":["replacecallback!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["callback"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["C"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"where","children":["where"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"Identifier","children":["C"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["FluxTraining"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Callback"},"tag":"reference","children":["Callback"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["cbidx"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["findfirst"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["isa"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbs"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["C"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["isnothing"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cbidx"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["FluxTraining"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.addcallback!"},"tag":"reference","children":["addcallback!"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["callback"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["nothing"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"else","children":["else"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["oldcb"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbs"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cbidx"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbs"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cbidx"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["callback"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["FluxTraining"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.setcallbacks!"},"tag":"reference","children":["setcallbacks!"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbs"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["oldcb"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" removecallback!(learner, C)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Remove the first callback of type `C` from `learner` and return it.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["If there is none, return `nothing`.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.removecallback!"},"tag":"reference","children":["removecallback!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["C"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"curly","children":[{"attributes":{},"tag":"Identifier","children":["Type"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{},"tag":"<:","children":[{"attributes":{},"tag":"<:","children":["<:"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["FluxTraining"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Callback"},"tag":"reference","children":["Callback"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["cbidx"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["findfirst"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["isa"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbs"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["C"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["isnothing"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cbidx"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["nothing"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["popat!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbs"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cbidx"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Callbacks"},"tag":"reference","children":["Callbacks"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbs"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file diff --git a/data/FluxTraining@dev/src/functional/metrics.jl.json b/data/FluxTraining@dev/src/functional/metrics.jl.json index 4b9f97ec1..ce5fe7d5b 100644 --- a/data/FluxTraining@dev/src/functional/metrics.jl.json +++ b/data/FluxTraining@dev/src/functional/metrics.jl.json @@ -1 +1 @@ -{"attributes":{"backlinks":[],"path":"/home/runner/.julia/packages/FluxTraining/xCOPx/src/functional/metrics.jl","package_id":"FluxTraining@dev","title":"FluxTraining/functional/metrics.jl","module_id":"FluxTraining"},"tag":"sourcefile","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.accuracy"},"tag":"reference","children":["accuracy"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["y_pred"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["y"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["mean"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["onecold"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["y_pred"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"==","children":[".=="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["onecold"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["y"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file +{"attributes":{"backlinks":[],"path":"/home/runner/.julia/packages/FluxTraining/imTF4/src/functional/metrics.jl","package_id":"FluxTraining@dev","title":"FluxTraining/functional/metrics.jl","module_id":"FluxTraining"},"tag":"sourcefile","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.accuracy"},"tag":"reference","children":["accuracy"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["y_pred"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["y"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["mean"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["onecold"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["y_pred"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"==","children":[".=="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["onecold"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["y"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file diff --git a/data/FluxTraining@dev/src/learner.jl.json b/data/FluxTraining@dev/src/learner.jl.json index 822031e33..ebd21af6b 100644 --- a/data/FluxTraining@dev/src/learner.jl.json +++ b/data/FluxTraining@dev/src/learner.jl.json @@ -1 +1 @@ -{"attributes":{"backlinks":[],"path":"/home/runner/.julia/packages/FluxTraining/xCOPx/src/learner.jl","package_id":"FluxTraining@dev","title":"FluxTraining/learner.jl","module_id":"FluxTraining"},"tag":"sourcefile","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"mutable","children":["mutable"],"type":"node"},{"attributes":{},"tag":"true","children":[""],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Callbacks"},"tag":"reference","children":["Callbacks"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["cbs"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Vector"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["runner"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.CallbackRunner"},"tag":"reference","children":["CallbackRunner"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["graph"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["SimpleDiGraph"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["initialized"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Bool"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Callbacks"},"tag":"reference","children":["Callbacks"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cbs"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["runner"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.LinearRunner"},"tag":"reference","children":["LinearRunner"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Callbacks"},"tag":"reference","children":["Callbacks"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cbs"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["runner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.callbackgraph"},"tag":"reference","children":["callbackgraph"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cbs"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"false","children":["false"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.init!"},"tag":"reference","children":["init!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["cbs"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Callbacks"},"tag":"reference","children":["Callbacks"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["foreach"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"->","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"->","children":["->"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.init!"},"tag":"reference","children":["init!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["cbs"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbs"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"mutable","children":["mutable"],"type":"node"},{"attributes":{},"tag":"true","children":[""],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Learner"},"tag":"reference","children":["Learner"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.PropDict"},"tag":"reference","children":["PropDict"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["optimizer"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["lossfn"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Comment","children":["# this used to store `Flux.Params` but now stores the optimiser state"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Comment","children":["# if an optim from Optimisers.jl is used"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["params"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["step"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.PropDict"},"tag":"reference","children":["PropDict"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Callbacks"},"tag":"reference","children":["Callbacks"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.PropDict"},"tag":"reference","children":["PropDict"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" Learner(model, lossfn; [callbacks = [], optimizer = ADAM(), kwargs...])\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Holds and coordinates all state of the training. `model` is trained by\n"],"type":"node"},{"attributes":{},"tag":"String","children":["optimizing `lossfn` with `optimizer` on `data`.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["## Arguments\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Positional arguments:\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- `model`: A Flux.jl model or a `NamedTuple` of models.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- `lossfn`: Loss function with signature `lossfn(model(x), y) -> Number`.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Keyword arguments (optional):\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- `data = ()`: Data iterators. A 2-tuple will be treated as `(trainingdataiter, validdataiter)`.\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" You can also pass in an empty tuple `()` and use the [`epoch!`](#) method with a\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" `dataiter` as third argument.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" A data iterator is an iterable over batches. For regular supervised training,\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" each batch should be a tuple `(xs, ys)`.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- `optimizer = ADAM()`: The optimizer used to update the `model`'s weights\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- `callbacks = []`: A list of callbacks that should be used. If `usedefaultcallbacks == true`,\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" this will be extended by the default callbacks\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- `usedefaultcallbacks = true`: Whether to add some basic callbacks. Included\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" are [`Metrics`](#), [`Recorder`](#), [`ProgressPrinter`](#),\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" [`StopOnNaNLoss`](#), and [`MetricsPrinter`](#).\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- `cbrunner = LinearRunner()`: Callback runner to use.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["## Fields\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["*(Use this as a reference when implementing callbacks)*\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- `model`, `optimizer`, and `lossfn` are stored as passed in\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- `data` is a `PropDict` of data iterators, usually `:training` and `:validation`.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- `params`: An instance of `model`'s parameters of type `Flux.Params`. If `model` is\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" a `NamedTuple`, then `params` is a `NamedTuple` as well.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- `step::`[`PropDict`](#): State of the last step. Contents depend on the last run\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" [`Phase`](#).\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- `cbstate::`[`PropDict`](#): Special state container that callbacks can\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" save state to for other callbacks. Its keys depend on what callbacks\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" are being used. See the [custom callbacks guide](/docs/docs/callbacks/custom.md)\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" for more info.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Learner"},"tag":"reference","children":["Learner"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["lossfn"],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"vect","children":[{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["optimizer"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["ADAM"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"...","children":[{"attributes":{},"tag":"Identifier","children":["kwargs"],"type":"node"},{"attributes":{},"tag":"...","children":["..."],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Learner"},"tag":"reference","children":["Learner"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["optimizer"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["lossfn"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"...","children":[{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"},{"attributes":{},"tag":"...","children":["..."],"type":"node"}],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"...","children":[{"attributes":{},"tag":"Identifier","children":["kwargs"],"type":"node"},{"attributes":{},"tag":"...","children":["..."],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"p","children":[{"attributes":{"element":"Callback"},"tag":"span","children":["note that Vararg is covariant, using Vararg"],"type":"node"}," produces warning"],"type":"node"}],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" Learner(model, data, optimizer, lossfn, [callbacks...; kwargs...])\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Learner"},"tag":"reference","children":["Learner"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["optimizer"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["lossfn"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"curly","children":[{"attributes":{},"tag":"Identifier","children":["Vararg"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Callback"},"tag":"reference","children":["Callback"],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["usedefaultcallbacks"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"true","children":["true"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["cbrunner"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.LinearRunner"},"tag":"reference","children":["LinearRunner"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["collect"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Callback"},"tag":"reference","children":["Callback"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["usedefaultcallbacks"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"for","children":[{"attributes":{},"tag":"for","children":["for"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"in","children":["in"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.defaultcallbacks"},"tag":"reference","children":["defaultcallbacks"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"!","children":["!"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["any"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["typeof"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"==","children":[".=="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["typeof"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["push!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["cbs"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Callbacks"},"tag":"reference","children":["Callbacks"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cbrunner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Learner"},"tag":"reference","children":["Learner"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["_dataiters"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["optimizer"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["lossfn"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.setupoptimstate"},"tag":"reference","children":["setupoptimstate"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["optimizer"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.PropDict"},"tag":"reference","children":["PropDict"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cbs"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.PropDict"},"tag":"reference","children":["PropDict"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.init!"},"tag":"reference","children":["init!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cbs"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Base"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["show"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["io"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["IO"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Learner"},"tag":"reference","children":["Learner"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["print"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["io"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Learner()"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.defaultcallbacks"},"tag":"reference","children":["defaultcallbacks"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"curly","children":[{"attributes":{},"tag":"Identifier","children":["Vector"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.AbstractCallback"},"tag":"reference","children":["AbstractCallback"],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"vect","children":[{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ProgressPrinter"},"tag":"reference","children":["ProgressPrinter"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.MetricsPrinter"},"tag":"reference","children":["MetricsPrinter"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.StopOnNaNLoss"},"tag":"reference","children":["StopOnNaNLoss"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Recorder"},"tag":"reference","children":["Recorder"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Metrics"},"tag":"reference","children":["Metrics"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"p","children":["Callback handling"],"type":"node"}],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.handle"},"tag":"reference","children":["handle"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["event"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.handle"},"tag":"reference","children":["handle"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["runner"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["event"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"p","children":["Other"],"type":"node"}],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.phasedataiter"},"tag":"reference","children":["phasedataiter"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.AbstractTrainingPhase"},"tag":"reference","children":["AbstractTrainingPhase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["training"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.phasedataiter"},"tag":"reference","children":["phasedataiter"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.AbstractValidationPhase"},"tag":"reference","children":["AbstractValidationPhase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["validation"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.model!"},"tag":"reference","children":["model!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["params"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.setupoptimstate"},"tag":"reference","children":["setupoptimstate"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["optimizer"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"p","children":["Flux.jl optimisers store ",{"attributes":{},"tag":"code","children":["params"],"type":"node"},", while Optimisers.jl store the result of ",{"attributes":{},"tag":"code","children":["setup"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.setupoptimstate"},"tag":"reference","children":["setupoptimstate"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Flux"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["Optimise"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["AbstractOptimiser"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Flux"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["params"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"p","children":["Optimisers.jl has no abstract supertype so we assume non-Flux optimisers conform to the Optimisers.jl interface."],"type":"node"}],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.setupoptimstate"},"tag":"reference","children":["setupoptimstate"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["optim"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Optimisers"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["setup"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["optim"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["_dataiters"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["d"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.PropDict"},"tag":"reference","children":["PropDict"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["d"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["_dataiters"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["t"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["NamedTuple"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.PropDict"},"tag":"reference","children":["PropDict"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["pairs"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["t"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["_dataiters"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["t"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Tuple"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["length"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["t"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"==","children":["=="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["0"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.PropDict"},"tag":"reference","children":["PropDict"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"curly","children":[{"attributes":{},"tag":"Identifier","children":["Dict"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Symbol"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Any"],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"elseif","children":[{"attributes":{},"tag":"elseif","children":["elseif"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["length"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["t"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"==","children":["=="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["1"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["_dataiters"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["training"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":"Identifier","children":["t"],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Integer","children":["1"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"elseif","children":[{"attributes":{},"tag":"elseif","children":["elseif"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["length"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["t"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"==","children":["=="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["2"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["_dataiters"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["training"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":"Identifier","children":["t"],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Integer","children":["1"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["validation"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":"Identifier","children":["t"],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Integer","children":["2"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"else","children":["else"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["error"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Please pass a `NamedTuple` or `PropDict` as `data`."],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file +{"attributes":{"backlinks":[],"path":"/home/runner/.julia/packages/FluxTraining/imTF4/src/learner.jl","package_id":"FluxTraining@dev","title":"FluxTraining/learner.jl","module_id":"FluxTraining"},"tag":"sourcefile","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"mutable","children":["mutable"],"type":"node"},{"attributes":{},"tag":"true","children":[""],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Callbacks"},"tag":"reference","children":["Callbacks"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["cbs"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Vector"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["runner"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.CallbackRunner"},"tag":"reference","children":["CallbackRunner"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["graph"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["SimpleDiGraph"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["initialized"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Bool"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Callbacks"},"tag":"reference","children":["Callbacks"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cbs"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["runner"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.LinearRunner"},"tag":"reference","children":["LinearRunner"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Callbacks"},"tag":"reference","children":["Callbacks"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cbs"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["runner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.callbackgraph"},"tag":"reference","children":["callbackgraph"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cbs"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"false","children":["false"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.init!"},"tag":"reference","children":["init!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["cbs"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Callbacks"},"tag":"reference","children":["Callbacks"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["foreach"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"->","children":[{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"->","children":["->"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.init!"},"tag":"reference","children":["init!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["cbs"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["cbs"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"mutable","children":["mutable"],"type":"node"},{"attributes":{},"tag":"true","children":[""],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Learner"},"tag":"reference","children":["Learner"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.PropDict"},"tag":"reference","children":["PropDict"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["optimizer"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["lossfn"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Comment","children":["# this used to store `Flux.Params` but now stores the optimiser state"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Comment","children":["# if an optim from Optimisers.jl is used"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["params"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["step"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.PropDict"},"tag":"reference","children":["PropDict"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Callbacks"},"tag":"reference","children":["Callbacks"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["cbstate"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.PropDict"},"tag":"reference","children":["PropDict"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" Learner(model, lossfn; [callbacks = [], optimizer = ADAM(), kwargs...])\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Holds and coordinates all state of the training. `model` is trained by\n"],"type":"node"},{"attributes":{},"tag":"String","children":["optimizing `lossfn` with `optimizer` on `data`.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["## Arguments\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Positional arguments:\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- `model`: A Flux.jl model or a `NamedTuple` of models.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- `lossfn`: Loss function with signature `lossfn(model(x), y) -> Number`.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Keyword arguments (optional):\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- `data = ()`: Data iterators. A 2-tuple will be treated as `(trainingdataiter, validdataiter)`.\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" You can also pass in an empty tuple `()` and use the [`epoch!`](#) method with a\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" `dataiter` as third argument.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" A data iterator is an iterable over batches. For regular supervised training,\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" each batch should be a tuple `(xs, ys)`.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- `optimizer = ADAM()`: The optimizer used to update the `model`'s weights\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- `callbacks = []`: A list of callbacks that should be used. If `usedefaultcallbacks == true`,\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" this will be extended by the default callbacks\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- `usedefaultcallbacks = true`: Whether to add some basic callbacks. Included\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" are [`Metrics`](#), [`Recorder`](#), [`ProgressPrinter`](#),\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" [`StopOnNaNLoss`](#), and [`MetricsPrinter`](#).\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- `cbrunner = LinearRunner()`: Callback runner to use.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["## Fields\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["*(Use this as a reference when implementing callbacks)*\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- `model`, `optimizer`, and `lossfn` are stored as passed in\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- `data` is a `PropDict` of data iterators, usually `:training` and `:validation`.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- `params`: An instance of `model`'s parameters of type `Flux.Params`. If `model` is\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" a `NamedTuple`, then `params` is a `NamedTuple` as well.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- `step::`[`PropDict`](#): State of the last step. Contents depend on the last run\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" [`Phase`](#).\n"],"type":"node"},{"attributes":{},"tag":"String","children":["- `cbstate::`[`PropDict`](#): Special state container that callbacks can\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" save state to for other callbacks. Its keys depend on what callbacks\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" are being used. See the [custom callbacks guide](/docs/docs/callbacks/custom.md)\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" for more info.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Learner"},"tag":"reference","children":["Learner"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["lossfn"],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"vect","children":[{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["optimizer"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["ADAM"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"...","children":[{"attributes":{},"tag":"Identifier","children":["kwargs"],"type":"node"},{"attributes":{},"tag":"...","children":["..."],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Learner"},"tag":"reference","children":["Learner"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["optimizer"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["lossfn"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"...","children":[{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"},{"attributes":{},"tag":"...","children":["..."],"type":"node"}],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"...","children":[{"attributes":{},"tag":"Identifier","children":["kwargs"],"type":"node"},{"attributes":{},"tag":"...","children":["..."],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"p","children":[{"attributes":{"element":"Callback"},"tag":"span","children":["note that Vararg is covariant, using Vararg"],"type":"node"}," produces warning"],"type":"node"}],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" Learner(model, data, optimizer, lossfn, [callbacks...; kwargs...])\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Learner"},"tag":"reference","children":["Learner"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["optimizer"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["lossfn"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"curly","children":[{"attributes":{},"tag":"Identifier","children":["Vararg"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Callback"},"tag":"reference","children":["Callback"],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["usedefaultcallbacks"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"true","children":["true"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["cbrunner"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.LinearRunner"},"tag":"reference","children":["LinearRunner"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["collect"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Callback"},"tag":"reference","children":["Callback"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["usedefaultcallbacks"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"for","children":[{"attributes":{},"tag":"for","children":["for"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"in","children":["in"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.defaultcallbacks"},"tag":"reference","children":["defaultcallbacks"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"!","children":["!"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["any"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["typeof"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"==","children":[".=="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["typeof"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["push!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cb"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["cbs"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Callbacks"},"tag":"reference","children":["Callbacks"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cbrunner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Learner"},"tag":"reference","children":["Learner"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["_dataiters"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["optimizer"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["lossfn"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.setupoptimstate"},"tag":"reference","children":["setupoptimstate"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["optimizer"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.PropDict"},"tag":"reference","children":["PropDict"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cbs"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.PropDict"},"tag":"reference","children":["PropDict"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.init!"},"tag":"reference","children":["init!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["cbs"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Base"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["show"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["io"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["IO"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Learner"},"tag":"reference","children":["Learner"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["print"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["io"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Learner()"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.defaultcallbacks"},"tag":"reference","children":["defaultcallbacks"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"curly","children":[{"attributes":{},"tag":"Identifier","children":["Vector"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.AbstractCallback"},"tag":"reference","children":["AbstractCallback"],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"vect","children":[{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.ProgressPrinter"},"tag":"reference","children":["ProgressPrinter"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.MetricsPrinter"},"tag":"reference","children":["MetricsPrinter"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.StopOnNaNLoss"},"tag":"reference","children":["StopOnNaNLoss"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Recorder"},"tag":"reference","children":["Recorder"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Metrics"},"tag":"reference","children":["Metrics"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"p","children":["Callback handling"],"type":"node"}],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.handle"},"tag":"reference","children":["handle"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["event"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.handle"},"tag":"reference","children":["handle"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["runner"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["event"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"p","children":["Other"],"type":"node"}],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.phasedataiter"},"tag":"reference","children":["phasedataiter"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.AbstractTrainingPhase"},"tag":"reference","children":["AbstractTrainingPhase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["training"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.phasedataiter"},"tag":"reference","children":["phasedataiter"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.AbstractValidationPhase"},"tag":"reference","children":["AbstractValidationPhase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["validation"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.model!"},"tag":"reference","children":["model!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["params"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.setupoptimstate"},"tag":"reference","children":["setupoptimstate"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["optimizer"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"p","children":["Flux.jl optimisers store ",{"attributes":{},"tag":"code","children":["params"],"type":"node"},", while Optimisers.jl store the result of ",{"attributes":{},"tag":"code","children":["setup"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.setupoptimstate"},"tag":"reference","children":["setupoptimstate"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Flux"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["Optimise"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["AbstractOptimiser"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Flux"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["params"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"p","children":["Optimisers.jl has no abstract supertype so we assume non-Flux optimisers conform to the Optimisers.jl interface."],"type":"node"}],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.setupoptimstate"},"tag":"reference","children":["setupoptimstate"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["optim"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Optimisers"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["setup"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["optim"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["_dataiters"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["d"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.PropDict"},"tag":"reference","children":["PropDict"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["d"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["_dataiters"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["t"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["NamedTuple"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.PropDict"},"tag":"reference","children":["PropDict"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["pairs"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["t"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["_dataiters"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["t"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Tuple"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["length"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["t"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"==","children":["=="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["0"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.PropDict"},"tag":"reference","children":["PropDict"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"curly","children":[{"attributes":{},"tag":"Identifier","children":["Dict"],"type":"node"},{"attributes":{},"tag":"{","children":["{"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Symbol"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Any"],"type":"node"},{"attributes":{},"tag":"}","children":["}"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"elseif","children":[{"attributes":{},"tag":"elseif","children":["elseif"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["length"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["t"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"==","children":["=="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["1"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["_dataiters"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["training"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":"Identifier","children":["t"],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Integer","children":["1"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"elseif","children":[{"attributes":{},"tag":"elseif","children":["elseif"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["length"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["t"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"==","children":["=="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["2"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["_dataiters"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["training"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":"Identifier","children":["t"],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Integer","children":["1"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["validation"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":"Identifier","children":["t"],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Integer","children":["2"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"else","children":["else"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["error"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Please pass a `NamedTuple` or `PropDict` as `data`."],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file diff --git a/data/FluxTraining@dev/src/testutils.jl.json b/data/FluxTraining@dev/src/testutils.jl.json index c706a36e9..bd5e6d0d7 100644 --- a/data/FluxTraining@dev/src/testutils.jl.json +++ b/data/FluxTraining@dev/src/testutils.jl.json @@ -1 +1 @@ -{"attributes":{"backlinks":[],"path":"/home/runner/.julia/packages/FluxTraining/xCOPx/src/testutils.jl","package_id":"FluxTraining@dev","title":"FluxTraining/testutils.jl","module_id":"FluxTraining"},"tag":"sourcefile","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"p","children":["This file defines ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.testlearner"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["testlearner"],"type":"node"}],"type":"node"}," that constructs a ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.Learner"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["Learner"],"type":"node"}],"type":"node"}," with a very simple optimisation problem. This should be used in tests for callbacks."],"type":"node"}],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.TestModel"},"tag":"reference","children":["TestModel"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["coeff"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.TestModel"},"tag":"reference","children":["TestModel"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["coeff"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Number"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.TestModel"},"tag":"reference","children":["TestModel"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"vect","children":[{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["coeff"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Flux"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["trainable"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["m"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.TestModel"},"tag":"reference","children":["TestModel"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["m"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["coeff"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["m"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.TestModel"},"tag":"reference","children":["TestModel"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["x"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["x"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"*","children":[".*"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["m"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["coeff"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Flux"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["functor"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.TestModel"},"tag":"reference","children":["TestModel"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.testbatch"},"tag":"reference","children":["testbatch"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["batchsize"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["coeff"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["xs"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["rand"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Float","children":["1."],"type":"node"},{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Float","children":["100."],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["batchsize"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["xs"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["xs"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"*","children":[".*"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["coeff"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.testbatches"},"tag":"reference","children":["testbatches"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["n"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Int"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["coeff"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["batchsize"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["8"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"generator","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.testbatch"},"tag":"reference","children":["testbatch"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["batchsize"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["coeff"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"for","children":["for"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["_"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"∈","children":["∈"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["1"],"type":"node"},{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["n"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" testlearner(callbacks...[; opt, nbatches, coeff, batchsize, kwargs...])\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Construct a [`Learner`](#) with a simple optimization problem. This\n"],"type":"node"},{"attributes":{},"tag":"String","children":["learner should be used in tests that require training a model, e.g.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["for callbacks.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.testlearner"},"tag":"reference","children":["testlearner"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"...","children":[{"attributes":{},"tag":"Identifier","children":["args"],"type":"node"},{"attributes":{},"tag":"...","children":["..."],"type":"node"}],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["opt"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["Descent"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Float","children":["0.001"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["nbatches"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["16"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["coeff"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["3"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["batchsize"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["8"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["usedefaultcallbacks"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"false","children":["false"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"...","children":[{"attributes":{},"tag":"Identifier","children":["kwargs"],"type":"node"},{"attributes":{},"tag":"...","children":["..."],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.TestModel"},"tag":"reference","children":["TestModel"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["rand"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["collect"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.testbatches"},"tag":"reference","children":["testbatches"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["nbatches"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["coeff"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["batchsize"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Learner"},"tag":"reference","children":["Learner"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["opt"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Flux"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["mae"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"...","children":[{"attributes":{},"tag":"Identifier","children":["args"],"type":"node"},{"attributes":{},"tag":"...","children":["..."],"type":"node"}],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["usedefaultcallbacks"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["usedefaultcallbacks"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"...","children":[{"attributes":{},"tag":"Identifier","children":["kwargs"],"type":"node"},{"attributes":{},"tag":"...","children":["..."],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file +{"attributes":{"backlinks":[],"path":"/home/runner/.julia/packages/FluxTraining/imTF4/src/testutils.jl","package_id":"FluxTraining@dev","title":"FluxTraining/testutils.jl","module_id":"FluxTraining"},"tag":"sourcefile","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"p","children":["This file defines ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.testlearner"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["testlearner"],"type":"node"}],"type":"node"}," that constructs a ",{"attributes":{"reftype":"symbol","href":"#","title":"","document_id":"FluxTraining@dev/ref/FluxTraining.Learner"},"tag":"reference","children":[{"attributes":{},"tag":"code","children":["Learner"],"type":"node"}],"type":"node"}," with a very simple optimisation problem. This should be used in tests for callbacks."],"type":"node"}],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"struct","children":[{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"struct","children":["struct"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.TestModel"},"tag":"reference","children":["TestModel"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["coeff"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.TestModel"},"tag":"reference","children":["TestModel"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["coeff"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Number"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.TestModel"},"tag":"reference","children":["TestModel"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"vect","children":[{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Identifier","children":["coeff"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Flux"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["trainable"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["m"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.TestModel"},"tag":"reference","children":["TestModel"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["m"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["coeff"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["m"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.TestModel"},"tag":"reference","children":["TestModel"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["x"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["x"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"*","children":[".*"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["m"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["coeff"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Flux"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["functor"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.TestModel"},"tag":"reference","children":["TestModel"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.testbatch"},"tag":"reference","children":["testbatch"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["batchsize"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["coeff"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["xs"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["rand"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Float","children":["1."],"type":"node"},{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Float","children":["100."],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["batchsize"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["xs"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["xs"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"*","children":[".*"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["coeff"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.testbatches"},"tag":"reference","children":["testbatches"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["n"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Int"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["coeff"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["batchsize"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["8"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"generator","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.testbatch"},"tag":"reference","children":["testbatch"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["batchsize"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["coeff"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"for","children":["for"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["_"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"∈","children":["∈"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["1"],"type":"node"},{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["n"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" testlearner(callbacks...[; opt, nbatches, coeff, batchsize, kwargs...])\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Construct a [`Learner`](#) with a simple optimization problem. This\n"],"type":"node"},{"attributes":{},"tag":"String","children":["learner should be used in tests that require training a model, e.g.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["for callbacks.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.testlearner"},"tag":"reference","children":["testlearner"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"...","children":[{"attributes":{},"tag":"Identifier","children":["args"],"type":"node"},{"attributes":{},"tag":"...","children":["..."],"type":"node"}],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["opt"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["Descent"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Float","children":["0.001"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["nbatches"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["16"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["coeff"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["3"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["batchsize"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["8"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["usedefaultcallbacks"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"false","children":["false"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"...","children":[{"attributes":{},"tag":"Identifier","children":["kwargs"],"type":"node"},{"attributes":{},"tag":"...","children":["..."],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.TestModel"},"tag":"reference","children":["TestModel"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["rand"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["collect"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.testbatches"},"tag":"reference","children":["testbatches"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["nbatches"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["coeff"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["batchsize"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Learner"},"tag":"reference","children":["Learner"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["opt"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Flux"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["mae"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"...","children":[{"attributes":{},"tag":"Identifier","children":["args"],"type":"node"},{"attributes":{},"tag":"...","children":["..."],"type":"node"}],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["usedefaultcallbacks"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["usedefaultcallbacks"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"...","children":[{"attributes":{},"tag":"Identifier","children":["kwargs"],"type":"node"},{"attributes":{},"tag":"...","children":["..."],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file diff --git a/data/FluxTraining@dev/src/training.jl.json b/data/FluxTraining@dev/src/training.jl.json index 3c928ef5a..90fdc839b 100644 --- a/data/FluxTraining@dev/src/training.jl.json +++ b/data/FluxTraining@dev/src/training.jl.json @@ -1 +1 @@ -{"attributes":{"backlinks":[],"path":"/home/runner/.julia/packages/FluxTraining/xCOPx/src/training.jl","package_id":"FluxTraining@dev","title":"FluxTraining/training.jl","module_id":"FluxTraining"},"tag":"sourcefile","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" epoch!(learner, phase[, dataiter])\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Train `learner` for one epoch on `dataiter`. Iterates through\n"],"type":"node"},{"attributes":{},"tag":"String","children":["`dataiter` and [`step!`](#)s for each batch/item.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["If no data iterator is passed in, use `learner.data[phasedataiter(phase)]`.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["## Extending\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["The default implementation iterates over every batch in `dataiter`\n"],"type":"node"},{"attributes":{},"tag":"String","children":["and calls [`step!`](#) for each. This behavior can be overloaded\n"],"type":"node"},{"attributes":{},"tag":"String","children":["by implementing `epoch!(learner, ::MyPhase, dataiter)`.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["If you're implementing a custom `epoch!` method, it is recommended\n"],"type":"node"},{"attributes":{},"tag":"String","children":["you make use of [`runepoch`](#) to get begin and end events as well\n"],"type":"node"},{"attributes":{},"tag":"String","children":["as proper handling of [`CancelEpochException`](#)s.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["See the default implementation for reference.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.epoch!"},"tag":"reference","children":["epoch!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.Phase"},"tag":"reference","children":["Phase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["dataiter"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.phasedataiter"},"tag":"reference","children":["phasedataiter"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"do","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.runepoch"},"tag":"reference","children":["runepoch"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"do","children":["do"],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["_"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"for","children":[{"attributes":{},"tag":"for","children":["for"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["batch"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"in","children":["in"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["dataiter"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.step!"},"tag":"reference","children":["step!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["batch"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" step!(learner, phase::Phase, batch)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Run one step of training for `learner` on batch.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Behavior is customized through `phase`.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["## Extending\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["This is a required method for custom [`Phase`](#)s to implement.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["To implement `step!`, it is recommended you make use of [`runstep`](#)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["to get begin and end events as well as proper handling of\n"],"type":"node"},{"attributes":{},"tag":"String","children":["[`CancelStepException`](#)s.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["See the implementations of [`TrainingPhase`](#) and [`ValidationPhase`](#)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["for reference.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.step!"},"tag":"reference","children":["step!"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.step!"},"tag":"reference","children":["step!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.TrainingPhase"},"tag":"reference","children":["TrainingPhase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["batch"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"Identifier","children":["xs"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ys"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["batch"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"do","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.runstep"},"tag":"reference","children":["runstep"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["xs"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Identifier","children":["xs"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["ys"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ys"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"do","children":["do"],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.handle"},"tag":"reference","children":["handle"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["grads"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"do","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["_gradient"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["optimizer"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["params"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"do","children":["do"],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["ŷs"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["xs"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.handle"},"tag":"reference","children":["handle"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.LossBegin"},"tag":"reference","children":["LossBegin"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["loss"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["lossfn"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["ŷs"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["ys"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.handle"},"tag":"reference","children":["handle"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.BackwardBegin"},"tag":"reference","children":["BackwardBegin"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["loss"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.handle"},"tag":"reference","children":["handle"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.BackwardEnd"},"tag":"reference","children":["BackwardEnd"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["params"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["_update!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["optimizer"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["params"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["grads"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"p","children":["Handle both old Flux.jl and new Optimisers.jl optimisers"],"type":"node"}],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["_gradient"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["f"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["_"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["m"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["_"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["gradient"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["f"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["m"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Integer","children":["1"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["_gradient"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["f"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Flux"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["Optimise"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["AbstractOptimiser"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["m"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["ps"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Params"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["gradient"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"->","children":[{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"->","children":["->"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["f"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["m"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ps"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["_update!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["optimizer"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Flux"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["Optimise"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["AbstractOptimiser"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["params"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["grads"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["update!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["optimizer"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["params"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["grads"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["params"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["_update!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["_"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["st"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["grads"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"Identifier","children":["st"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Optimisers"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["update!"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["st"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["grads"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["st"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.step!"},"tag":"reference","children":["step!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.ValidationPhase"},"tag":"reference","children":["ValidationPhase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["batch"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"Identifier","children":["xs"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ys"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["batch"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"do","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.runstep"},"tag":"reference","children":["runstep"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["xs"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Identifier","children":["xs"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["ys"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ys"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"do","children":["do"],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["_"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["ŷs"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["xs"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["loss"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["lossfn"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["ŷs"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["ys"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" runepoch(epochfn, learner, phase)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Run `epochfn` inside the context of an epoch. Calls `epochfn(handle)`\n"],"type":"node"},{"attributes":{},"tag":"String","children":["where `handle(e)` can be called to dispatch events.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Takes care of dispatching [`EpochBegin`](#) and [`EpochEnd`](#)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["events as well as handling [`CancelEpochException`](#)s.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.runepoch"},"tag":"reference","children":["runepoch"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["epochfn"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.Phase"},"tag":"reference","children":["Phase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["handlefn"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["e"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.handle"},"tag":"reference","children":["handle"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["runner"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["e"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"try","children":[{"attributes":{},"tag":"try","children":["try"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["handlefn"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.EpochBegin"},"tag":"reference","children":["EpochBegin"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["epochfn"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["handlefn"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["handlefn"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.EpochEnd"},"tag":"reference","children":["EpochEnd"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"catch","children":["catch"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["e"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["e"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"isa","children":["isa"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.CancelEpochException"},"tag":"reference","children":["CancelEpochException"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["debug"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Epoch skipped"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["error"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["e"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["handlefn"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.EpochEnd"},"tag":"reference","children":["EpochEnd"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"else","children":["else"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["rethrow"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" runstep(stepfn, learner, phase) -> state\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Run `stepfn` inside the context of a step. Calls `stepfn(handle, state)`\n"],"type":"node"},{"attributes":{},"tag":"String","children":["where `handle(e)` can be called to dispatch events and `state` is a [`PropDict`](#)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["which step data, gradients and losses can be written to. Return `state`.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Takes care of dispatching [`StepBegin`](#) and [`StepEnd`](#)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["events as well as handling [`CancelStepException`](#)s.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.runstep"},"tag":"reference","children":["runstep"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["stepfn"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.Phase"},"tag":"reference","children":["Phase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["initialstate"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.PropDict"},"tag":"reference","children":["PropDict"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["pairs"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["initialstate"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["handlefn"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["e"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.handle"},"tag":"reference","children":["handle"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["runner"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["e"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"try","children":[{"attributes":{},"tag":"try","children":["try"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["step"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["handlefn"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.StepBegin"},"tag":"reference","children":["StepBegin"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["stepfn"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["handlefn"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["handlefn"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.StepEnd"},"tag":"reference","children":["StepEnd"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"catch","children":["catch"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["e"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["e"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"isa","children":["isa"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.CancelStepException"},"tag":"reference","children":["CancelStepException"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["debug"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Step skipped"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["error"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["e"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"else","children":["else"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["rethrow"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"p","children":["Utilities"],"type":"node"}],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" fit!(learner, nepochs)\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" fit!(learner, nepochs, (trainiter, validiter))\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Train `learner` for `nepochs` of training and validation each. Use data\n"],"type":"node"},{"attributes":{},"tag":"String","children":["iterators that are passed in. If none are given, use `learner.data.training`\n"],"type":"node"},{"attributes":{},"tag":"String","children":["and `learner.data.validation`.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["## Examples\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["```julia\n"],"type":"node"},{"attributes":{},"tag":"String","children":["fit!(learner, 10)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["fit!(learner, 10, (traindl, valdl))\n"],"type":"node"},{"attributes":{},"tag":"String","children":["```\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.fit!"},"tag":"reference","children":["fit!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["nepochs"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Int"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["trainiter"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["validiter"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"for","children":[{"attributes":{},"tag":"for","children":["for"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["i"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"in","children":["in"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["1"],"type":"node"},{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["nepochs"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.epoch!"},"tag":"reference","children":["epoch!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.TrainingPhase"},"tag":"reference","children":["TrainingPhase"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["trainiter"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.epoch!"},"tag":"reference","children":["epoch!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.ValidationPhase"},"tag":"reference","children":["ValidationPhase"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["validiter"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.fit!"},"tag":"reference","children":["fit!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["nepochs"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Int"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.fit!"},"tag":"reference","children":["fit!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["nepochs"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["training"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["validation"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file +{"attributes":{"backlinks":[],"path":"/home/runner/.julia/packages/FluxTraining/imTF4/src/training.jl","package_id":"FluxTraining@dev","title":"FluxTraining/training.jl","module_id":"FluxTraining"},"tag":"sourcefile","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" epoch!(learner, phase[, dataiter])\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Train `learner` for one epoch on `dataiter`. Iterates through\n"],"type":"node"},{"attributes":{},"tag":"String","children":["`dataiter` and [`step!`](#)s for each batch/item.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["If no data iterator is passed in, use `learner.data[phasedataiter(phase)]`.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["## Extending\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["The default implementation iterates over every batch in `dataiter`\n"],"type":"node"},{"attributes":{},"tag":"String","children":["and calls [`step!`](#) for each. This behavior can be overloaded\n"],"type":"node"},{"attributes":{},"tag":"String","children":["by implementing `epoch!(learner, ::MyPhase, dataiter)`.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["If you're implementing a custom `epoch!` method, it is recommended\n"],"type":"node"},{"attributes":{},"tag":"String","children":["you make use of [`runepoch`](#) to get begin and end events as well\n"],"type":"node"},{"attributes":{},"tag":"String","children":["as proper handling of [`CancelEpochException`](#)s.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["See the default implementation for reference.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.epoch!"},"tag":"reference","children":["epoch!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.Phase"},"tag":"reference","children":["Phase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["dataiter"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.phasedataiter"},"tag":"reference","children":["phasedataiter"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"do","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.runepoch"},"tag":"reference","children":["runepoch"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"do","children":["do"],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["_"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"for","children":[{"attributes":{},"tag":"for","children":["for"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["batch"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"in","children":["in"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["dataiter"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.step!"},"tag":"reference","children":["step!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["batch"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" step!(learner, phase::Phase, batch)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Run one step of training for `learner` on batch.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Behavior is customized through `phase`.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["## Extending\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["This is a required method for custom [`Phase`](#)s to implement.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["To implement `step!`, it is recommended you make use of [`runstep`](#)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["to get begin and end events as well as proper handling of\n"],"type":"node"},{"attributes":{},"tag":"String","children":["[`CancelStepException`](#)s.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["See the implementations of [`TrainingPhase`](#) and [`ValidationPhase`](#)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["for reference.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.step!"},"tag":"reference","children":["step!"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.step!"},"tag":"reference","children":["step!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.TrainingPhase"},"tag":"reference","children":["TrainingPhase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["batch"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"Identifier","children":["xs"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ys"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["batch"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"do","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.runstep"},"tag":"reference","children":["runstep"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["xs"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Identifier","children":["xs"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["ys"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ys"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"do","children":["do"],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.handle"},"tag":"reference","children":["handle"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["grads"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"do","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["_gradient"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["optimizer"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["params"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"do","children":["do"],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["ŷs"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["xs"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.handle"},"tag":"reference","children":["handle"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.LossBegin"},"tag":"reference","children":["LossBegin"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["loss"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["lossfn"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["ŷs"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["ys"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.handle"},"tag":"reference","children":["handle"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.BackwardBegin"},"tag":"reference","children":["BackwardBegin"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["loss"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.handle"},"tag":"reference","children":["handle"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.BackwardEnd"},"tag":"reference","children":["BackwardEnd"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["params"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["_update!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["optimizer"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["params"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["grads"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"p","children":["Handle both old Flux.jl and new Optimisers.jl optimisers"],"type":"node"}],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["_gradient"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["f"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["_"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["m"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["_"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"ref","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["gradient"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["f"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["m"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"[","children":["["],"type":"node"},{"attributes":{},"tag":"Integer","children":["1"],"type":"node"},{"attributes":{},"tag":"]","children":["]"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["_gradient"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["f"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Flux"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["Optimise"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["AbstractOptimiser"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["m"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["ps"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Params"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["gradient"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"->","children":[{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"->","children":["->"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["f"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["m"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ps"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["_update!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["optimizer"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Flux"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["Optimise"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["AbstractOptimiser"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["params"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["grads"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["update!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["optimizer"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["params"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["grads"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["params"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["_update!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["_"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["st"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["grads"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"Identifier","children":["st"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["Optimisers"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["update!"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["st"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["grads"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["st"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.step!"},"tag":"reference","children":["step!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.ValidationPhase"},"tag":"reference","children":["ValidationPhase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["batch"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"Identifier","children":["xs"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ys"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["batch"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"do","children":[{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.runstep"},"tag":"reference","children":["runstep"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["xs"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Identifier","children":["xs"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["ys"],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Identifier","children":["ys"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"do","children":["do"],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["_"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["ŷs"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["model"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["xs"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["loss"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["lossfn"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["ŷs"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["ys"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" runepoch(epochfn, learner, phase)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Run `epochfn` inside the context of an epoch. Calls `epochfn(handle)`\n"],"type":"node"},{"attributes":{},"tag":"String","children":["where `handle(e)` can be called to dispatch events.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Takes care of dispatching [`EpochBegin`](#) and [`EpochEnd`](#)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["events as well as handling [`CancelEpochException`](#)s.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.runepoch"},"tag":"reference","children":["runepoch"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["epochfn"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.Phase"},"tag":"reference","children":["Phase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["handlefn"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["e"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.handle"},"tag":"reference","children":["handle"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["runner"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["e"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"try","children":[{"attributes":{},"tag":"try","children":["try"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["handlefn"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.EpochBegin"},"tag":"reference","children":["EpochBegin"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["epochfn"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["handlefn"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["handlefn"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.EpochEnd"},"tag":"reference","children":["EpochEnd"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"catch","children":["catch"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["e"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["e"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"isa","children":["isa"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.CancelEpochException"},"tag":"reference","children":["CancelEpochException"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["debug"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Epoch skipped"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["error"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["e"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["handlefn"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.EpochEnd"},"tag":"reference","children":["EpochEnd"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"else","children":["else"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["rethrow"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" runstep(stepfn, learner, phase) -> state\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Run `stepfn` inside the context of a step. Calls `stepfn(handle, state)`\n"],"type":"node"},{"attributes":{},"tag":"String","children":["where `handle(e)` can be called to dispatch events and `state` is a [`PropDict`](#)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["which step data, gradients and losses can be written to. Return `state`.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Takes care of dispatching [`StepBegin`](#) and [`StepEnd`](#)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["events as well as handling [`CancelStepException`](#)s.\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.runstep"},"tag":"reference","children":["runstep"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["stepfn"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.Phase"},"tag":"reference","children":["Phase"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"kw","children":[{"attributes":{},"tag":"Identifier","children":["initialstate"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"parameters","children":[{"attributes":{},"tag":";","children":[";"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.PropDict"},"tag":"reference","children":["PropDict"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["pairs"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["initialstate"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["handlefn"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["e"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.handle"},"tag":"reference","children":["handle"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["callbacks"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["runner"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["e"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["phase"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"try","children":[{"attributes":{},"tag":"try","children":["try"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["step"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["handlefn"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.StepBegin"},"tag":"reference","children":["StepBegin"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["stepfn"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["handlefn"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["handlefn"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Events.StepEnd"},"tag":"reference","children":["StepEnd"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"catch","children":["catch"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["e"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"if","children":[{"attributes":{},"tag":"if","children":["if"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["e"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"isa","children":["isa"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.CancelStepException"},"tag":"reference","children":["CancelStepException"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"@","children":["@"],"type":"node"},{"attributes":{},"tag":"MacroName","children":["debug"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"","children":["\""],"type":"node"},{"attributes":{},"tag":"String","children":["Step skipped"],"type":"node"},{"attributes":{},"tag":"\"","children":["\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["error"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"=","children":["="],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["e"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"else","children":["else"],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Identifier","children":["rethrow"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"false","children":[""],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"return","children":[{"attributes":{},"tag":"return","children":["return"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["state"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"md","children":[{"attributes":{},"tag":"p","children":["Utilities"],"type":"node"}],"type":"node"},{"attributes":{"lang":"julia"},"tag":"codeblock","children":[{"attributes":{},"tag":"julia","children":[{"attributes":{},"tag":"macrocall","children":[{"attributes":{},"tag":"core_@doc","children":[""],"type":"node"},{"attributes":{},"tag":"string","children":[{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" fit!(learner, nepochs)\n"],"type":"node"},{"attributes":{},"tag":"String","children":[" fit!(learner, nepochs, (trainiter, validiter))\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["Train `learner` for `nepochs` of training and validation each. Use data\n"],"type":"node"},{"attributes":{},"tag":"String","children":["iterators that are passed in. If none are given, use `learner.data.training`\n"],"type":"node"},{"attributes":{},"tag":"String","children":["and `learner.data.validation`.\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["## Examples\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"String","children":["```julia\n"],"type":"node"},{"attributes":{},"tag":"String","children":["fit!(learner, 10)\n"],"type":"node"},{"attributes":{},"tag":"String","children":["fit!(learner, 10, (traindl, valdl))\n"],"type":"node"},{"attributes":{},"tag":"String","children":["```\n"],"type":"node"},{"attributes":{},"tag":"String","children":["\n"],"type":"node"},{"attributes":{},"tag":"\"\"\"","children":["\"\"\""],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.fit!"},"tag":"reference","children":["fit!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["nepochs"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Int"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["trainiter"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["validiter"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"for","children":[{"attributes":{},"tag":"for","children":["for"],"type":"node"},{"attributes":{},"tag":"=","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["i"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"in","children":["in"],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Integer","children":["1"],"type":"node"},{"attributes":{},"tag":":","children":[":"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["nepochs"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.epoch!"},"tag":"reference","children":["epoch!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.TrainingPhase"},"tag":"reference","children":["TrainingPhase"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["trainiter"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.epoch!"},"tag":"reference","children":["epoch!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.Phases.ValidationPhase"},"tag":"reference","children":["ValidationPhase"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["validiter"],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"},{"attributes":{},"tag":"function","children":[{"attributes":{},"tag":"function","children":["function"],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.fit!"},"tag":"reference","children":["fit!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"::","children":[{"attributes":{},"tag":"Identifier","children":["nepochs"],"type":"node"},{"attributes":{},"tag":"::","children":["::"],"type":"node"},{"attributes":{},"tag":"Identifier","children":["Int"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"block","children":[{"attributes":{},"tag":"NewlineWs","children":["\n "],"type":"node"},{"attributes":{},"tag":"call","children":[{"attributes":{"reftype":"symbol","document_id":"FluxTraining@dev/ref/FluxTraining.fit!"},"tag":"reference","children":["fit!"],"type":"node"},{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"Identifier","children":["nepochs"],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":"tuple","children":[{"attributes":{},"tag":"(","children":["("],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["training"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":",","children":[","],"type":"node"},{"attributes":{},"tag":"Whitespace","children":[" "],"type":"node"},{"attributes":{},"tag":".","children":[{"attributes":{},"tag":".","children":[{"attributes":{},"tag":"Identifier","children":["learner"],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["data"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":".","children":["."],"type":"node"},{"attributes":{},"tag":"quote","children":[{"attributes":{},"tag":"Identifier","children":["validation"],"type":"node"}],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":")","children":[")"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"NewlineWs","children":["\n"],"type":"node"}],"type":"node"},{"attributes":{},"tag":"end","children":["end"],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"}],"type":"node"} \ No newline at end of file diff --git a/dev/FluxTraining@dev/doc/CHANGELOG.md.html b/dev/FluxTraining@dev/doc/CHANGELOG.md.html index b44280689..106d0ff22 100644 --- a/dev/FluxTraining@dev/doc/CHANGELOG.md.html +++ b/dev/FluxTraining@dev/doc/CHANGELOG.md.html @@ -9,18 +9,18 @@ - + - + - - + + - - + +