Skip to content

Conversation

@markusgumbel
Copy link
Contributor

Fixed issue #398.

  • Changed file char-rnn.jl according to description/sugesstion in issue text.
  • Set Julia version to 1.10. The Julia 1.10 runtime was not able to run the 1.6 version.

Comment on lines +69 to +72
Xtext = [collect(t) for t in chunk(text, args.batchsz)]
Ytext = [collect(t) for t in chunk(text[2:end], args.batchsz)]
Xs = partition(batchseq(Xtext, stop), args.seqlen)
Ys = partition(batchseq(Ytext, stop), args.seqlen)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain the reasoning behind this change? Generally, I would not expect collect to be required here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem seems to be that chunk(text, args.batchsz) creates an array of SubStrings. batchseq calls ndims on this array. However, ndims does not seem to be defined for SubStrings. The Strings are converted into an array of characters (for which ndims is available).
Without the change you get:
ERROR: LoadError: MethodError: no method matching ndims(::SubString{String})

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. We should fix batchseq to work with strings, but that can happen separately. Thanks for elaborating.

Copy link
Member

@ToucheSir ToucheSir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for updating this!

@ToucheSir ToucheSir merged commit d4de9e1 into FluxML:master Feb 9, 2024
@markusgumbel
Copy link
Contributor Author

Thank you, too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants