Project

General

Profile

Actions

Feature #14116

closed

Add Matrix #exponentiate method as Matlab's exp

Added by greggzst (Grzegorz Jakubiak) over 6 years ago. Updated over 6 years ago.

Status:
Feedback
Target version:
-
[ruby-core:83827]

Description

Add exponentiate method which results in returning a new matrix with each element being an exponent of the number e.
Here is PR for that: https://github.com/ruby/ruby/pull/1762

Actions #1

Updated by greggzst (Grzegorz Jakubiak) over 6 years ago

  • Description updated (diff)
Actions #2

Updated by greggzst (Grzegorz Jakubiak) over 6 years ago

  • Subject changed from Add Matrix #exponentiate method to Add Matrix #exponentiate method as Matlab's exp

Updated by marcandre (Marc-Andre Lafortune) over 6 years ago

  • Status changed from Open to Feedback
  • Assignee set to marcandre (Marc-Andre Lafortune)

Thanks for the PR.

The name is not acceptable, as the exponential of a matrix is something different (expm in Matlab): https://en.wikipedia.org/wiki/Matrix_exponential

I wish I was more familiar with machine learning to know how frequent calculating this is. If it is, there should be a name for this, no?

The fact that map{|e| Math.exp(e)} is quite simple to do makes me even more hesitant to add that method too.

Updated by MSP-Greg (Greg L) over 6 years ago

marcandre (Marc-Andre Lafortune) wrote:

Thanks for the PR.

The name is not acceptable, as the exponential of a matrix is something different

I agree. Not quite a single line method. Maybe something like entrywise_exp or entrywise_exponential like in 60860. But as you mentioned, 'is quite simple'...

Updated by shevegen (Robert A. Heiler) over 6 years ago

Once again it is back to the oldest problem in computer technology - giving things a proper name. :-)

Updated by greggzst (Grzegorz Jakubiak) over 6 years ago

marcandre (Marc-Andre Lafortune) wrote:

Thanks for the PR.

The name is not acceptable, as the exponential of a matrix is something different (expm in Matlab): https://en.wikipedia.org/wiki/Matrix_exponential

I wish I was more familiar with machine learning to know how frequent calculating this is. If it is, there should be a name for this, no?

The fact that map{|e| Math.exp(e)} is quite simple to do makes me even more hesitant to add that method too.

I changed the name to entrywise_exp as suggested. True about the simplicity but it would be a good shorthand taking into consideration fact that it is used in many cases e.g. multivariate normal distribution.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0