horn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Edward J. Yoon" <edwardy...@apache.org>
Subject Re: Use vector instead of Iterable in neuron API
Date Fri, 26 Aug 2016 09:43:35 GMT
Hi,

Good point. I was aimed to parallelization of neuron objects using
multi-threading. The original purpose of iterable msgs, is related
with memory consumption issue (message serialization). BTW, thread
within thread seems possible [1].

And, In forward() method, we usually computes the weighted sum. This
computation can be parallelized and thread safe.

1. http://stackoverflow.com/questions/7224670/threads-within-threads-in-java


On Fri, Aug 26, 2016 at 6:01 PM, Baran Topal <barantopal@barantopal.com> wrote:
> Hi;
>
> First message, please be kind :)
>
> Is thread safety an important aspect in this context? Vectors are
> threadsafe but the complexity (e.g. removal of an element) might not
> be very desirable for performant applications. I will try to test and
> inform you between two solutions with tests once I have time.
>
> Br.
>
> 2016-08-26 2:40 GMT+02:00 Edward J. Yoon <edward.yoon@samsung.com>:
>> Hi forks,
>>
>> Our current neuron API is designed like:
>> https://github.com/apache/incubator-horn/blob/master/README.md#programming-m
>> odel
>>
>> In forward() method, each neuron receives the pairs of the inputs x1, x2,
>> ... xn from other neurons and weights w1, w2, ... wn like below:
>>
>>   public void forward(Iterable<M> messages) throws IOException;
>>
>> Instead of this, I suggest that we use just vector like below:
>>
>>   /**
>>    * @param input vector from other neurons
>>    * /
>>   public void forward(Vector input) throws IOException;
>>
>> And, the neuron provides a getWeightVector() method that returns weight
>> vector associated with itself. I think this is more make sense than current
>> version, and more easy to use GPU in the future.
>>
>> What do you think?
>>
>> Thanks.
>>
>> --
>> Best Regards, Edward J. Yoon
>>
>>
>>
>>



-- 
Best Regards, Edward J. Yoon

Mime
View raw message