It sounds like you are applying your filter with rank 3 (i. e. per channel), in which case nothing will change.  But you could reorganize your data to  be Width x Height x Depth X Channels, and then you might want to apply a filter function to a block of wxhxdxc at each position of wxhxd, which would be something like

   data =: i. 4 5 6 3  NB. w h d c
   kernel =: i. 2 2 2   NB. filter kernel
   filter =. +/@:(8 3&($,))@:(kernel&*)
   $ (1 1 1,:2 2 2) filter;._3 data
3 4 5 1 3   NB. pre-8.07
3 4 5 3   NB. 8.07

Henry Rich

On 4/20/2018 12:04 AM, 'Jon Hough' via Programming wrote:
"Subarrays (u;.3 and u;._3) has been rewritten for virtual blocks. In
previous releases (x u;.3 y) when applied to rank-2 y was pretty fast,
but all other cases were slow, even when applying an x with 2 columns to
a y of rank 3.  So, if you wanted to do an image operation on RGB
pixels, with shape hxwx3, you would wait. Now the operations are quick
enough to use - I get a 7x7 convolution on a 1000x1000 image in under a
second.  One part of the change is incompatible with previous releases:
if x does not specify all axes of y, those axes are taken in full but do
not appear in the shape of the result.  Previously the omitted axis was
put into the result-shape where it usually had to be removed."

I am convolving Channels x Depth x Width x Height tensors for my
rather primitive convnet implementation. I am rather confused by the sentence:

"if x does not specify all axes of y, those axes are taken in full but do
not appear in the shape of the result."

I have a 4-d tensor, which can be RGB channels, arbitrary depth, and image 
width, height.
convolving with a filter (with some stride) of shape 2 3 $ stride, stride, 
stride, depth, width, height
to produce a new 4-d tensor.
I assume this will need to be rewritten.


--------------------------------------------
On Fri, 4/20/18, Henry Rich <[email protected]> wrote:

  Subject: [Jprogramming] Features of the new beta
  To: [email protected]
  Date: Friday, April 20, 2018, 5:16 AM
The new beta continues to
  integrate virtual-block support, which lets
  sections of nouns be used as arguments without
  copying them. The main
  beneficiary this
  time is Rank - any u"n will execute u on virtual cells
of n.  (, y), (x { y), and (x $ y) also
  produce virtual results when
  they can.
Subarrays (u;.3 and u;._3) has
  been rewritten for virtual blocks. In
  previous releases (x u;.3 y) when applied to
  rank-2 y was pretty fast,
  but all other
  cases were slow, even when applying an x with 2 columns to
a y of rank 3.  So, if you wanted to do an
  image operation on RGB
  pixels, with shape
  hxwx3, you would wait. Now the operations are quick
  enough to use - I get a 7x7 convolution on a
  1000x1000 image in under a
  second.  One
  part of the change is incompatible with previous releases:
if x does not specify all axes of y, those
  axes are taken in full but do
  not appear in
  the shape of the result.  Previously the omitted axis was
put into the result-shape where it usually
  had to be removed.
One coding hint: assignments
  cause virtual blocks to be realized (i. e.
  copied to a new block of their own).  If you
  write
substr =. 1000 {.
  3000 }. , 200 { bigarray
there will be no copying of data until you get
  to the final assignment:
  the other
  operations use virtual blocks.  But if you write
substr =. 1000 {. dropped =.
  3000 }. raveled =. , selected =. 200 { bigarray
the data will be copied to a
  new block for every assignment.
The cd verb,
  which calls DLLs, has been changed so that it makes copies
of its arguments before passing them to the
  DLL.  Now that we have
  virtual blocks,
  it's just too dangerous to pass a pointer to a J noun,
because that noun might be part of another
  noun.  [If you really need to
  do it,
  there's a way, but you have to want it bad enough to
  comb the
  documentation].
This means that owners of
  libraries that call DLLs need to make sure
  they use only the boxed result of cd, and NOT
  rely on a side-effect like
  a change to a
  name that was in the argument list to the DLL.  The name
will be protected from change. Henry Rich ---
  This email has been checked
  for viruses by AVG.
  http://www.avg.com
----------------------------------------------------------------------
  For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm


---
This email has been checked for viruses by AVG.
http://www.avg.com

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to