Alternatives to Lua as an embedded language?

I am working on an embedded system running Linux on a DSP. Now we want to make some parts of it scriptable and we are looking for a nice embeddable scripting language. These scripts should integrate nicely with our existing C++ code base, be small and fast. I understand that Lua is the industry choice … Read more

Lua pattern matching vs. regular expressions

I’m currently learning lua. regarding pattern-matching in lua I found the following sentence in the lua documentation on Nevertheless, pattern matching in Lua is a powerful tool and includes some features that are difficult to match with standard POSIX implementations. As I’m familiar with posix regular expressions I would like to know if there … Read more

Is Lua based primarily on well-established programming-language ideas? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for … Read more

Evaluation & Calculate Top-N Accuracy: Top 1 and Top 5

I have come across few (Machine learning-classification problem) journal papers mentioned about evaluate accuracy with Top-N approach. Data was show that Top 1 accuracy = 42.5%, and Top-5 accuracy = 72.5% in the same training, testing condition. I wonder how to calculate this percentage of top-1 and top-5? Can some one show me example and … Read more

How to check if matching text is found in a string in Lua?

I need to make a conditional that is true if a particular matching text is found at least once in a string of text, e.g.: str = “This is some text containing the word tiger.” if string.match(str, “tiger”) then print (“The word tiger was found.”) else print (“The word tiger was not found.”) How can … Read more

How to check if two Torch tensors or matrices are equal?

I need a Torch command that checks if two tensors have the same content, and returns TRUE if they have the same content. For example: local tens_a = torch.Tensor({9,8,7,6}); local tens_b = torch.Tensor({9,8,7,6}); if (tens_a EQUIVALENCE_COMMAND tens_b) then … end What should I use in this script instead of EQUIVALENCE_COMMAND ? I tried simply with … Read more