torch / DEPRECEATED-torch7-distro

Torch7: state-of-the-art machine learning algorithms

Home Page:www.torch.ch

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

torch.logspace bug?

soumith opened this issue · comments

y=torch.logspace(0,1) returns 100 points between 1.0 and 10.0

y=torch.logspace(2,3) returns points between 100 and 1000

does it return points between 10^x1 and 10^x2 rather than what the manual says:
"returns a one-dimensional tensor of 50 logarithmically eqally spaced points between x1 and x2."

I ran into this today... It's consistent with Matlab, no? Are you upset that the manual doesn't say that x1 and x2 are in logspace as well?

doh, i expected you get logspaced points from (x1,x2) (according to what the torch manual says).
So like linspace, but with the spacing scaled logarithmically.

Never used the matlab function.

I think that when I implemented that a long time ago I followed the Matlab behavior. Then maybe the guy who wrote the doc went a bit fast on it. Arg. Another motivation to write doc when you write a function ;)