Skip to content
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

Convolution basic implementation #115

Merged
merged 6 commits into from
Jan 14, 2014
Merged

Convolution basic implementation #115

merged 6 commits into from
Jan 14, 2014

Conversation

ktakagaki
Copy link
Contributor

Hi David et al.,

I am working on programming in basic FIR filter capabilities, and have finished the basics of a convolve() function for DenseVector[Double], with unit tests. I need input on option handling before I get too deep in filling out the code...

I've implemented an overhang option like this, with an option object:
def convolve[Input, Output](kernel: Input, data: Input, overhangOpt: OverhangOpt = OverhangOpt.Default()) (implicit canConvolve: CanConvolve[Input, Output]): Output

abstract class OverhangOpt object OverhangOpt{ case class Default() extends OverhangOpt case class Sequence(k: (Integer, Integer)) extends OverhangOpt case class Integer(k: Integer) extends OverhangOpt }

Is this along the lines of what you meant, David, when you were discussing how to handle options?
(https://groups.google.com/forum/#!topic/scala-breeze/o7A49ZYP1kg)

@dlwh
Copy link
Member

dlwh commented Jan 11, 2014

Yeah, I think this is exactly right. Also, could you look into the test
failure for the RandomAccessFile stuff (it showed up on this build):
https://travis-ci.org/scalanlp/breeze/jobs/16680369

Thanks!

-- David

On Thu, Jan 9, 2014 at 12:51 PM, ktakagaki notifications@github.com wrote:

Hi David et al.,

I am working on programming in basic FIR filter capabilities, and have
finished the basics of a convolve() function for DenseVector[Double], with
unit tests. I need input on option handling before I get too deep in
filling out the code...

I've implemented an overhang option like this, with an option object:
def convolve[Input, Output](kernel: Input, data: Input, overhangOpt:
OverhangOpt = OverhangOpt.Default%28%29)
(implicit canConvolve: CanConvolve[Input, Output]): Output

abstract class OverhangOpt
object OverhangOpt{
case class Default() extends OverhangOpt
case class Sequence(k: (Integer, Integer)) extends OverhangOpt
case class Integer(k: Integer) extends OverhangOpt
}

Is this along the lines of what you meant, David, when you were discussing
how to handle options?

(https://groups.google.com/forum/#!topic/scala-breeze/o7A49ZYP1kg)

You can merge this Pull Request by running

git pull https://github.com/ktakagaki/breeze master

Or view, comment on, or merge it at:

#115
Commit Summary

  • Convolution test implementation

File Changes

Patch Links:


Reply to this email directly or view it on GitHubhttps://github.com//pull/115
.

@dlwh
Copy link
Member

dlwh commented Jan 11, 2014

well, maybe just make Sequence take two ints rather than a pair of ints?
Also, I think think you meant for them to take "Integers", but probably
Ints?

-- David

On Sat, Jan 11, 2014 at 10:40 AM, David Hall dlwh@cs.berkeley.edu wrote:

Yeah, I think this is exactly right. Also, could you look into the test
failure for the RandomAccessFile stuff (it showed up on this build):
https://travis-ci.org/scalanlp/breeze/jobs/16680369

Thanks!

-- David

On Thu, Jan 9, 2014 at 12:51 PM, ktakagaki notifications@github.comwrote:

Hi David et al.,

I am working on programming in basic FIR filter capabilities, and have
finished the basics of a convolve() function for DenseVector[Double], with
unit tests. I need input on option handling before I get too deep in
filling out the code...

I've implemented an overhang option like this, with an option object:
def convolve[Input, Output](kernel: Input, data: Input, overhangOpt:
OverhangOpt = OverhangOpt.Default%28%29)
(implicit canConvolve: CanConvolve[Input, Output]): Output

abstract class OverhangOpt
object OverhangOpt{
case class Default() extends OverhangOpt
case class Sequence(k: (Integer, Integer)) extends OverhangOpt
case class Integer(k: Integer) extends OverhangOpt
}

Is this along the lines of what you meant, David, when you were
discussing how to handle options?

(https://groups.google.com/forum/#!topic/scala-breeze/o7A49ZYP1kg)

You can merge this Pull Request by running

git pull https://github.com/ktakagaki/breeze master

Or view, comment on, or merge it at:

#115
Commit Summary

  • Convolution test implementation

File Changes

Patch Links:


Reply to this email directly or view it on GitHubhttps://github.com//pull/115
.

@ktakagaki
Copy link
Contributor Author

OK regarding the Ints.

Regarding the Travis builds, the same tests are passing just fine on my
system, and on code review, I can't think of a reason why these two
specific functions/tests are failing and not others...
Google isn't helping either, do you have any ideas? I will keep thinking,
but I'm kind of stuck...

I've inserted some println()s in the test function to troubleshoot what's
happening on the Travis server, and filed a pull request, maybe that will
clarify...?
#115

Kenta

On Sat, Jan 11, 2014 at 7:41 PM, David Hall notifications@github.comwrote:

well, maybe just make Sequence take two ints rather than a pair of ints?
Also, I think think you meant for them to take "Integers", but probably
Ints?

-- David

On Sat, Jan 11, 2014 at 10:40 AM, David Hall dlwh@cs.berkeley.edu
wrote:

Yeah, I think this is exactly right. Also, could you look into the test
failure for the RandomAccessFile stuff (it showed up on this build):
https://travis-ci.org/scalanlp/breeze/jobs/16680369

Thanks!

-- David

On Thu, Jan 9, 2014 at 12:51 PM, ktakagaki notifications@github.comwrote:

Hi David et al.,

I am working on programming in basic FIR filter capabilities, and have
finished the basics of a convolve() function for DenseVector[Double],
with
unit tests. I need input on option handling before I get too deep in
filling out the code...

I've implemented an overhang option like this, with an option object:
def convolve[Input, Output](kernel: Input, data: Input, overhangOpt:
OverhangOpt = OverhangOpt.Default%28%29)
(implicit canConvolve: CanConvolve[Input, Output]): Output

abstract class OverhangOpt
object OverhangOpt{
case class Default() extends OverhangOpt
case class Sequence(k: (Integer, Integer)) extends OverhangOpt
case class Integer(k: Integer) extends OverhangOpt
}

Is this along the lines of what you meant, David, when you were
discussing how to handle options?

(https://groups.google.com/forum/#!topic/scala-breeze/o7A49ZYP1kg)

You can merge this Pull Request by running

git pull https://github.com/ktakagaki/breeze master

Or view, comment on, or merge it at:

#115
Commit Summary

  • Convolution test implementation

File Changes

Patch Links:


Reply to this email directly or view it on GitHub<
https://github.com/scalanlp/breeze/pull/115>
.


Reply to this email directly or view it on GitHubhttps://github.com//pull/115#issuecomment-32103482
.

@ktakagaki
Copy link
Contributor Author

OK. I think I've solved the issue, it was that the Travis server was automatically deleting the temporary file "temp.bin" used for testing the binary writing functions. Since the delete was at indeterminate time, different tests were failing on different runs. The issue was solved by committing the temporary file "temp.bin" to the resources folder, I guess this flags it as something that the Travis server shouldn't touch, or something like that.

@dlwh
Copy link
Member

dlwh commented Jan 14, 2014

Thanks!

On Mon, Jan 13, 2014 at 4:33 AM, ktakagaki notifications@github.com wrote:

OK. I think I've solved the issue, it was that the Travis server was
automatically deleting the temporary file "temp.bin" used for testing the
binary writing functions. Since the delete was at indeterminate time,
different tests were failing on different runs. The issue was solved by
committing the temporary file "temp.bin" to the resources folder, I guess
this flags it as something that the Travis server shouldn't touch, or
something like that.


Reply to this email directly or view it on GitHubhttps://github.com//pull/115#issuecomment-32165228
.

dlwh added a commit that referenced this pull request Jan 14, 2014
Convolution basic implementation
@dlwh dlwh merged commit d6dc13d into scalanlp:master Jan 14, 2014
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.

None yet

2 participants