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
BrainScript: BS.Constants.Range for a constant tensor containing a range of integers #2121
Comments
Unfortunately there's no official plan to add new features to BrainScript. This is the main reason why CNTK is switching from BrainScript to Python. |
@KeDengMS Thanks a lot for your follow-up. That's really a pity though. Python is a show-stopper from a .NET perspective (see #960). BrainScript is highly manageable from a .NET perspective, and it's an excellent DSL use case. Can I submit the |
@vermorel Thanks for offering to add this feature to BrainScript, please send a PR. BTW, I don't think using BrainScript or Python affects your choices over .NET. You can always train a model with Python and load it into .NET, and even use .NET to generate python code if needed. What we want to deliver is not some ideology, it's just a tool to help people get their job done faster and better. Machine learning is moving at fast pace so should we. In my mind Python has more flexibility and extensibility than BrainScript in a lot of ways, which is essential for data pre/post processing. |
PR has merged. Closing this issue now. |
I am facing a problem where the network needs a mask of 0s and 1s starting with k ones and followed by n-k zeroes, where k is is provided as part of the input sequence, and where n is a constant of the problem.
By introducing a
BS.Constants.Range
, which takes a single argument, obtaining the mask is straightforward:There is a possible work-around with the option
initFromFilePath
from theParameterTensor
; however, it's quite tedious (one ah-hoc input file to be generated for each n).What would you suggest to cope with such a situation? What about adding
BS.Constants.Range
?Update1: I am wondering if
BS.Constants.Range(n)
cannot be obtained through arrays. However, arrays seems to be intended for higher-level constructs. It's unclear to me if it's possible to convert afloat
array into a tensor.Update2: It seems that the following might work:
Could someone confirm that it will behave as intended?
The text was updated successfully, but these errors were encountered: