# Tag Info

### Machine Learning Golf: Multiplication

21 13 11 9 weights This is based on the polarization identity of bilinear forms which in the one dimensional real case reduces to the polynomial identity: $$x\cdot y = \frac{(x+y)^2 - (x-y)^2}{4}$$ ...
• 43.8k

7 weights ...
• 145k

### Machine Learning Golf: Multiplication

33 31 weights ...
• 15.7k

### Machine Learning Golf: Multiplication

43 weights The two solutions posted so far have been very clever but their approaches likely won't work for more traditional tasks in machine learning (like OCR). Hence I'd like to submit a 'generic' ...

### Can a neural network recognize primes?

Trial division: score 59407, 6243 layers, 16478 neurons in total Given as a Python program which generates and validates the net. See the comments in trial_division...
• 43.1k

### Sort with a neural network

Octave, 96 88 87 84 76 54 50 weights & biases This 6-layer neural net is essentially a 3-step sorting network built from a very simple min/...
• 43.8k

### Implement the Max-Pooling operation from Convolutional Neural Networks

Python 3, 101 108 bytes def f(m,w):r=range(0,len(m),w);return[[max(sum([x[i:i+w]for x in m[j:j+w]],[]))for i in r]for j in r] Thanks to Jo King and Jonathan ...
• 822

### Machine Learning Golf: Multiplication

2 weights I was inspired by the other answers to approximate the polarization identity in a different way. For every small $\epsilon>0$, it holds that  xy \approx \frac{e^{\epsilon x+\epsilon ...
• 2,277

• 921

### Implement the Max-Pooling operation from Convolutional Neural Networks

Octave with Image Package, 38 bytes @(M,s)blockproc(M,[s s],@(b)max(b(:))) Try it online!
• 104k

### Find the largest root of a polynomial with a neural network

14,674,000,667 5,436,050 5,403,448 10,385 5,994 4,447 3,806 total precision For a baseline, I investigated the following approach: Select $M,\delta,\epsilon>0$ such that if we sample the ...
• 2,277

### Implement the Max-Pooling operation from Convolutional Neural Networks

J, 13 12 bytes >./\&|:^:2~- Try it online! ... When I said ";.3 is the right tool for the job", I was wrong. This ...
• 76k

### Implement the Max-Pooling operation from Convolutional Neural Networks

APL (Dyalog Unicode), 20 bytes {⌈⌿⍤2⌈/⍵}⊢⍴⍨4⍴÷⍨∘≢,⊣ Try it online! I'm pretty sure converting the dfn part into an atop ...
• 76k

### Implement the Max-Pooling operation from Convolutional Neural Networks

Python 2, 68 bytes lambda M,k:eval("map(lambda*l:map(max,zip(*[iter(l)]*k)),*"*2+"M))") Try it online! 74 bytes ...
• 145k

### Is this stack of CNN layers valid?

Python 3.8 (pre-release), 138 134 118 bytes ...
• 16.3k

### Implement the Max-Pooling operation from Convolutional Neural Networks

Wolfram Language (Mathematica), 23 bytes BlockMap[Max,#2,{#,#}]& Try it online!
• 231

### Implement the Max-Pooling operation from Convolutional Neural Networks

dzaima/APL, 14 12 bytes ⊣t¨t←⌈/⍬∘⍮⍛⍴ Try it online!
• 20.2k

### Implement the Max-Pooling operation from Convolutional Neural Networks

05AB1E, 8 7 bytes ôεø¹ôεZ -1 byte thanks to @Grimy. Stride as first input and matrix as second input. Try it online or verify all test cases. Explanation: ...
• 126k

• 2,277

### Is this stack of CNN layers valid?

J, 84 bytes Takes in a list of layers; mode x y for convolution, with _1 0 1 for min mid max,...
• 11.3k

### Is this stack of CNN layers valid?

05AB1E, 45 bytes sεÐgiĀ«]vyн³Dp-Nè©*-yθ/®+ÐïÊyнÈ®_*y`‹«à~i0q]1 Inspired by @fireflame241's ungolfed Python answer, so make sure to upvote him! Three loose inputs: ...
• 126k

### Implement the Max-Pooling operation from Convolutional Neural Networks

Charcoal, 24 bytes ＮθＩＥ⪪ＥＡＥ⪪ιθ⌈λθＥ§ι⁰⌈Ｅι§νμ Try it online! Link is to verbose version of code. Outputs each maximum on its own line, with matrix rows double-...
• 170k
1 vote

### Implement the Max-Pooling operation from Convolutional Neural Networks

Japt, 24 bytes mòY=UÊzV)Õc òYp)®rwÃòV y Try it ...
• 10.8k
1 vote

### Implement the Max-Pooling operation from Convolutional Neural Networks

Ruby, 57 bytes ->m,w{g=->r{r.transpose.each_slice(w).map &:max};g[g[m]]} Try it online!
• 21.9k
1 vote

### Implement the Max-Pooling operation from Convolutional Neural Networks

Stax, 11 bytes ó╚←XF«≡ûÖçx Run and debug it at staxlang.xyz! Unpacked (13 bytes) and explanation ...

Only top scored, non community-wiki answers of a minimum length are eligible