-
Notifications
You must be signed in to change notification settings - Fork 150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use Epochs to load CoLA #487
Conversation
The kokoro failure is looking for the functions defined at the bottom of DataUtilities.swift. @BradLarson do we have a common function to use instead? |
Yeah I just realized that, I deleted the two files thinking they were useless now but did not try to build after, sorry about that. I can leave DatasetUtilities with them for now, there is a TODO to rely on the swift-models at some point, when it is done, this can be removed. |
Datasets/CoLA/CoLA.swift
Outdated
public let batchSize: Int | ||
/// The type of the collection of batches. | ||
public typealias Batches = Slices<Sampling<Samples, ArraySlice<Int>>> | ||
/// The type of the training seauence of epochs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sp: sequence
Datasets/CoLA/CoLA.swift
Outdated
LazyMapSequence<Batches, LabeledTextBatch>> | ||
|
||
//public typealias DevDataIterator = GroupedIterator<MapIterator<ExampleIterator, DataBatch>> | ||
//public typealias TestDataIterator = DevDataIterator |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove commented lines
maxSequenceLength: maxSequenceLength, | ||
batchSize: batchSize, | ||
entropy: SystemRandomNumberGenerator() | ||
) { (example: CoLAExample) -> LabeledTextBatch in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are the advantages of moving to a trailing closure?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's more swift-idiomatic from what Dave constantly tells me ;)
The main advantage is that you don't have to define your exampleMap
function separately and pass it, you can just put in curly brackets at the end (like in the main colab example).
This is so helpful!! It cleans up the CoLA implementation considerably. Although there are aspects of |
Thanks! Hope the design review on Friday will clarify the aspects of Epochs that are unclear. |
Fixes #480 |
This PR changes the way CoLA is loaded to use the Epochs API.
It removes the test set (that was unused) and does the minimal amount of changes to work with the script in BertCoLA.
Two notes where the design changed:
Added functionality: we can pass a random generator and thus get reproducible results.