Re: interp2 for Clojure

2020-01-14 Thread Charles Harvey III
These are both fantastic. It has been 25 years since I had a serious math 
class (no Stats either - Set Theory, Category Theory), so this has taken me 
a few afternoons to wrap my head around.

Spline? Cubic? Bicubic? RBF? Shephard? And that's just interpolation.

Its weird that the Commons Math doesn't seem to have anything that is 
Linear or Bilinear. Everything is Bicubic.

Fastmath is a nice wrapper over all of these things. The bilinear function 
wraps the BilinearInterpolation class from Smile. Incanter has an 
interpolate-grid function as well, but Incanter hasn't been touched for a 
while and Fastmath has a lot of updates.

More interesting is that I am not using this for image processing. It is 
for Computer Assisted Testing. If you get an question right or wrong, you 
get a different next question. But the next isn't just based off 
right/wrong, it has a lot of other input. They are essentially doing 
Nearest Neighbor but want it to be smoother. I wonder if doing Bicubic 
would give the same results as Bilinear.

Thanks so much for the pointers, I really appreciate it.



Charlie


On Tuesday, January 14, 2020 at 4:25:47 PM UTC-5, Tomasz Sulej wrote:
>
> Check out my fastmath library: 
> https://generateme.github.io/fastmath/fastmath.interpolation.html

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/8de99d4a-35c7-4961-9cc3-dc063fc3e8ef%40googlegroups.com.


interp2 for Clojure

2020-01-14 Thread Tomasz Sulej
Check out my fastmath library: 
https://generateme.github.io/fastmath/fastmath.interpolation.html

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/13e01e2b-8f51-496a-a2d8-57b6dddef271%40googlegroups.com.


Re: interp2 for Clojure

2020-01-14 Thread Chris Nuernberger
Hey Charles,

Maybe check out the apache commons-math3 interpolators:
https://commons.apache.org/proper/commons-math/javadocs/api-3.6/org/apache/commons/math3/analysis/interpolation/package-summary.html

On Tue, Jan 14, 2020 at 11:04 AM Charles Harvey III <
charlesnhar...@gmail.com> wrote:

> Greetings.
> A current project I am working on needs to run a Bilinear Interpolation. R
> and Python (SciPy) have functions for this: interp2. I think this is just a
> fancy name for particular matrix multiplication. But I'm not really sure.
> Can I cobble this together in core.matrix? Incanter? Neanderthal? I know
> the question is a little broad, I'm just at the beginning of this.
>
> Thanks.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/clojure/d1ec49f4-b13c-4de0-b2f2-05de343881ec%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/CADbpEJvGtA3TmTfZeLDFGOLxu_1Kr_UaRrc-Q6A8cd1Xa311DA%40mail.gmail.com.


Re: [ANN] proxy-plus: Faster and more usable replacement for "proxy"

2020-01-14 Thread Brent Millare
Thanks this is wonderful! Nice work

On Tuesday, January 14, 2020 at 11:58:17 AM UTC-5, Nathan Marz wrote:
>
> The speedup comes from proxy+ directly overriding methods with the 
> provided implementation, while Clojure's proxy has additional indirection. 
> For example, if you do (proxy [Object] [] (toString [] "hello")), the 
> bytecode for toString is:
>
>   public java.lang.String toString();
>
>  0  aload_0 [this]
>
>  1  getfield user.proxy$java.lang.Object$ff19274a.__clojureFnMap : 
> clojure.lang.IPersistentMap [16]
>
>  4  ldc  [52]
>
>  6  invokestatic clojure.lang.RT.get(java.lang.Object, 
> java.lang.Object) : java.lang.Object [36]
>
>  9  dup
>
> 10  ifnull 28
>
> 13  checkcast clojure.lang.IFn [38]
>
> 16  aload_0 [this]
>
> 17  invokeinterface clojure.lang.IFn.invoke(java.lang.Object) : 
> java.lang.Object [55] [nargs: 2]
>
> 22  checkcast java.lang.String [57]
>
> 25  goto 33
>
> 28  pop
>
> 29  aload_0 [this]
>
> 30  invokespecial java.lang.Object.toString() : java.lang.String [59]
>
> 33  areturn
>
> Clojure keeps the implementations in a map, and for every dispatch it does 
> a map lookup by the method name. This is also why it can't handle 
> overriding the same method name with different arities.
>
> For (proxy+ [] Object (toString [this] "hello")), the bytecode is:
>
>   public java.lang.String toString();
>
>  0  aload_0 [this]
>
>  1  getfield user.proxy_plus5358.toString5357 : clojure.lang.IFn [19]
>
>  4  aload_0 [this]
>
>  5  invokeinterface clojure.lang.IFn.invoke(java.lang.Object) : 
> java.lang.Object [30] [nargs: 2]
>
> 10  checkcast java.lang.String [32]
>
> 13  areturn
>
> The implementation function is stored as a field, so the cost of dispatch 
> is a field get rather than a map lookup.
>
> Clojure's proxy also overrides *every* available method in all 
> superclasses/interfaces, while proxy+ only overrides what you specify. So 
> proxy+ generates much smaller classes than proxy.
>
>
> On Tuesday, January 14, 2020 at 10:30:32 AM UTC-5, Brent Millare wrote:
>>
>> I skimmed the code, I don't really understand how it makes it faster over 
>> proxy. Is it the generated ASM is better? What's the in-a-nutshell 
>> description of how it works?
>>
>> On Monday, January 13, 2020 at 1:28:46 PM UTC-5, Nathan Marz wrote:
>>>
>>> No differences in behavior except for API being like reify. It 
>>> integrates with AOT and can be consumed just like any other class. No idea 
>>> how it interacts with Graal.
>>>
>>> On Monday, January 13, 2020 at 12:29:35 PM UTC-5, John Newman wrote:

 Bravo 

 Are there any differences in behavior to be aware of? AOT, Graal, 
 consuming proxy+ classes from vanilla clojure classes?

 On Mon, Jan 13, 2020, 11:47 AM Nathan Marz  wrote:

> proxy+ is a replacement for Clojure's proxy that's faster and more 
> usable. proxy has a strange implementation where it overrides every 
> possible method and uses a mutable field to store a map of string -> 
> function for dispatching the methods. This causes it to be unable to 
> handle 
> methods with the same name but different arities.
>
> proxy+ fixes these issues with proxy. Usage is like reify, and it's up 
> to 10x faster.
>
> *Repository: *https://github.com/redplanetlabs/proxy-plus
>
> -- 
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clo...@googlegroups.com
> Note that posts from new members are moderated - please be patient 
> with your first post.
> To unsubscribe from this group, send email to
> clo...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> --- 
> You received this message because you are subscribed to the Google 
> Groups "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send 
> an email to clo...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/clojure/6d9bf48a-c5b5-417a-9f66-aa494cc38346%40googlegroups.com
>  
> 
> .
>


-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, 

interp2 for Clojure

2020-01-14 Thread Charles Harvey III
Greetings.
A current project I am working on needs to run a Bilinear Interpolation. R 
and Python (SciPy) have functions for this: interp2. I think this is just a 
fancy name for particular matrix multiplication. But I'm not really sure.
Can I cobble this together in core.matrix? Incanter? Neanderthal? I know 
the question is a little broad, I'm just at the beginning of this.

Thanks.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/d1ec49f4-b13c-4de0-b2f2-05de343881ec%40googlegroups.com.


Re: [ANN] proxy-plus: Faster and more usable replacement for "proxy"

2020-01-14 Thread Nathan Marz
The speedup comes from proxy+ directly overriding methods with the provided 
implementation, while Clojure's proxy has additional indirection. For 
example, if you do (proxy [Object] [] (toString [] "hello")), the bytecode 
for toString is:

  public java.lang.String toString();

 0  aload_0 [this]

 1  getfield user.proxy$java.lang.Object$ff19274a.__clojureFnMap : 
clojure.lang.IPersistentMap [16]

 4  ldc  [52]

 6  invokestatic clojure.lang.RT.get(java.lang.Object, 
java.lang.Object) : java.lang.Object [36]

 9  dup

10  ifnull 28

13  checkcast clojure.lang.IFn [38]

16  aload_0 [this]

17  invokeinterface clojure.lang.IFn.invoke(java.lang.Object) : 
java.lang.Object [55] [nargs: 2]

22  checkcast java.lang.String [57]

25  goto 33

28  pop

29  aload_0 [this]

30  invokespecial java.lang.Object.toString() : java.lang.String [59]

33  areturn

Clojure keeps the implementations in a map, and for every dispatch it does 
a map lookup by the method name. This is also why it can't handle 
overriding the same method name with different arities.

For (proxy+ [] Object (toString [this] "hello")), the bytecode is:

  public java.lang.String toString();

 0  aload_0 [this]

 1  getfield user.proxy_plus5358.toString5357 : clojure.lang.IFn [19]

 4  aload_0 [this]

 5  invokeinterface clojure.lang.IFn.invoke(java.lang.Object) : 
java.lang.Object [30] [nargs: 2]

10  checkcast java.lang.String [32]

13  areturn

The implementation function is stored as a field, so the cost of dispatch 
is a field get rather than a map lookup.

Clojure's proxy also overrides *every* available method in all 
superclasses/interfaces, while proxy+ only overrides what you specify. So 
proxy+ generates much smaller classes than proxy.


On Tuesday, January 14, 2020 at 10:30:32 AM UTC-5, Brent Millare wrote:
>
> I skimmed the code, I don't really understand how it makes it faster over 
> proxy. Is it the generated ASM is better? What's the in-a-nutshell 
> description of how it works?
>
> On Monday, January 13, 2020 at 1:28:46 PM UTC-5, Nathan Marz wrote:
>>
>> No differences in behavior except for API being like reify. It integrates 
>> with AOT and can be consumed just like any other class. No idea how it 
>> interacts with Graal.
>>
>> On Monday, January 13, 2020 at 12:29:35 PM UTC-5, John Newman wrote:
>>>
>>> Bravo 
>>>
>>> Are there any differences in behavior to be aware of? AOT, Graal, 
>>> consuming proxy+ classes from vanilla clojure classes?
>>>
>>> On Mon, Jan 13, 2020, 11:47 AM Nathan Marz  wrote:
>>>
 proxy+ is a replacement for Clojure's proxy that's faster and more 
 usable. proxy has a strange implementation where it overrides every 
 possible method and uses a mutable field to store a map of string -> 
 function for dispatching the methods. This causes it to be unable to 
 handle 
 methods with the same name but different arities.

 proxy+ fixes these issues with proxy. Usage is like reify, and it's up 
 to 10x faster.

 *Repository: *https://github.com/redplanetlabs/proxy-plus

 -- 
 You received this message because you are subscribed to the Google
 Groups "Clojure" group.
 To post to this group, send email to clo...@googlegroups.com
 Note that posts from new members are moderated - please be patient with 
 your first post.
 To unsubscribe from this group, send email to
 clo...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 --- 
 You received this message because you are subscribed to the Google 
 Groups "Clojure" group.
 To unsubscribe from this group and stop receiving emails from it, send 
 an email to clo...@googlegroups.com.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/clojure/6d9bf48a-c5b5-417a-9f66-aa494cc38346%40googlegroups.com
  
 
 .

>>>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/6793548f-0bc9-4c10-8e5c-cf235aaaccce%40googlegroups.com.


Re: Clojurists Together call for proposals (4 projects $9,000 each)

2020-01-14 Thread Daniel Compton
Hi folks

Applications for this close tomorrow. If you work on a Clojure open source
project that is important to the community (or a subset of the community)
we'd love to fund you. We haven't had many applications for this quarter
yet (though we also consider projects that applied over the last 3 funding
rounds).

I'm happy to review application drafts if people want some guidance or are
not sure if their application fits our funding structure.

Thanks, Daniel.

On Thu, Jan 9, 2020 at 8:26 PM Daniel Compton <
daniel.compton.li...@gmail.com> wrote:

> Hi folks
>
> Clojurists Together is going to be funding 4 Clojure open source projects
> from February - April. If you maintain an open source project that could
> use some funding, please consider applying.
>
> Applications close in a week on 15th January 11:59pm PST.
>
> The main things our members were interested
>  in:
>
>- Error messages
>- Documentation
>- Developer experience tools
>- Build tooling
>- IDE support
>- Test tooling
>- Linters
>- Profilers
>- Data analysis/processing frameworks
>
> If you work on any of these kinds of projects, please look at applying for
> funding. You can look at the survey results for more information on which
> projects and kinds of projects our members are interested in.
>
> You can apply at https://www.clojuriststogether.org/open-source/.
>
> If you have any questions about applying or your application, please get
> in touch. We're happy to talk about your application and answer any
> questions you have.
>
> Thanks to all of the company and developer members
>  who have funded this work,
> we couldn't do it without you.
>
> Thanks, Daniel.
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/CAK2UX_jESh1YKzWeo%3Du%2BbvS7qaGxKaKm44uvDRwxf2%3Dg-Dqg%3DA%40mail.gmail.com.


Re: [ANN] proxy-plus: Faster and more usable replacement for "proxy"

2020-01-14 Thread Brent Millare
I skimmed the code, I don't really understand how it makes it faster over 
proxy. Is it the generated ASM is better? What's the in-a-nutshell 
description of how it works?

On Monday, January 13, 2020 at 1:28:46 PM UTC-5, Nathan Marz wrote:
>
> No differences in behavior except for API being like reify. It integrates 
> with AOT and can be consumed just like any other class. No idea how it 
> interacts with Graal.
>
> On Monday, January 13, 2020 at 12:29:35 PM UTC-5, John Newman wrote:
>>
>> Bravo 
>>
>> Are there any differences in behavior to be aware of? AOT, Graal, 
>> consuming proxy+ classes from vanilla clojure classes?
>>
>> On Mon, Jan 13, 2020, 11:47 AM Nathan Marz  wrote:
>>
>>> proxy+ is a replacement for Clojure's proxy that's faster and more 
>>> usable. proxy has a strange implementation where it overrides every 
>>> possible method and uses a mutable field to store a map of string -> 
>>> function for dispatching the methods. This causes it to be unable to handle 
>>> methods with the same name but different arities.
>>>
>>> proxy+ fixes these issues with proxy. Usage is like reify, and it's up 
>>> to 10x faster.
>>>
>>> *Repository: *https://github.com/redplanetlabs/proxy-plus
>>>
>>> -- 
>>> You received this message because you are subscribed to the Google
>>> Groups "Clojure" group.
>>> To post to this group, send email to clo...@googlegroups.com
>>> Note that posts from new members are moderated - please be patient with 
>>> your first post.
>>> To unsubscribe from this group, send email to
>>> clo...@googlegroups.com
>>> For more options, visit this group at
>>> http://groups.google.com/group/clojure?hl=en
>>> --- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "Clojure" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to clo...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/clojure/6d9bf48a-c5b5-417a-9f66-aa494cc38346%40googlegroups.com
>>>  
>>> 
>>> .
>>>
>>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/1fdbb59a-73b5-4a79-94b1-6769578fe019%40googlegroups.com.