Live data from Hacker News

When to assume neural networks can solve a problem

blog.cerebralab.com

21–30 of 44 posts

Re: When to assume neural networks can solve a problem

#21
post #12

When a neural network solved a problem, it means it found the algebraic function it needs to solve the problem. > Once it found the algebraic function, there is no need to run the problem to the neural network. We can sideload the problem to a simple program that takes input and gives an output. This strategy can help to free up the GPU for next set of problem.

How would one extract an algebraic function from the network’s weights? Why would the function the network approximates necessarily be algebraic?

The function would simply be a chain of multiplications and (typically) non-linear transformations.

For classification problems, there is often a final non-linear transformation, like a softmax.

Example with ReLu activation:

Output_i = max((input_i * weight_i),0)

Re: When to assume neural networks can solve a problem

#22
post #18
post #8

I've been hearing about deep learning revolutionizing "everything" for the past 8 years. So, can someone name me any significant impact it made on figuring out what to do about the recent epidemic? If not, I think it's worth reflecting on what value we get out of the technology that sucked up so much of our intellectual, financial and computational resources.

If you're listening to people who claim any one technology solves "everything" --- and believing them --- then you are the fool. There's no silver bullet. Deep Learning has made huge strides in noise reduction, image and video processing (self driving cars), lidar processing, medical imaging, etc, but it's not made any progress in knitting, tooth brushing, dog walking, or many other tasks ill suited for deep learning…

Your general point is valid, but I can't help pointing out that knitting may not belong in that second list as much as the others.

Computational textile work is a niche, but fascinating, area of research. Knitting and crocheting are highly technical crafts, and there are opportunities to use modern computational approaches, including deep learning, in them.

Deep Knitting: https://arxiv.org/pdf/1902.02752.pdf

I'm not going to read this paper in detail, it may not be a great example of a successful deep learning application - but at least it's not an absurd idea.

Maybe not surprising if you're aware of the place of the Jacquard loom in the history of computer science.

Re: When to assume neural networks can solve a problem

#24

Earlier quoted context omitted.

How would one extract an algebraic function from the network’s weights? Why would the function the network approximates necessarily be algebraic?

The function would simply be a chain of multiplications and (typically) non-linear transformations. For classification problems, there is often a final non-linear transformation, like a softmax. Example with ReLu activation: Output_i = max((input_i * weight_i),0)

I don't understand. The example you gave is not an algebraic function.

Re: When to assume neural networks can solve a problem

#26
post #15

"That’s why building a product recommendation algorithm was a hot topic 20 years ago, but nowadays everyone and their mom can just get a WordPress plugin for it and get close to Amazon’s level." Well, I haven't had a remotely relevant Amazon recommendation in 5 to 10 years. Unless you count read a book by the exact same author as a useful recommendation.

At least on my account, it seems like Amazon has given up on recommendations and is just suggesting I buy the same things again. I wouldn't be shocked if it's actually quite a bit more accurate then real predictions, but it does lead to funny things like "You already bought this book? How about a second copy?"

I wonder if the same book recommendations are happening because people might just be buying products like these for gifts. Something like I liked this book, so you should read it to.

Re: When to assume neural networks can solve a problem

#27
post #19
post #18

Earlier quoted context omitted.

If you're listening to people who claim any one technology solves "everything" --- and believing them --- then you are the fool. There's no silver bullet. Deep Learning has made huge strides in noise reduction, image and video processing (self driving cars), lidar processing, medical imaging, etc, but it's not made any progress in knitting, tooth brushing, dog walking, or many other tasks ill suited for deep learning…

That's been the general vibe the popular tech press has been spouting for awhile. That NNs are somehow a major step towards AGI, which'll 'capture the lightcone of the future' to quote Sam Altman. At some point, we'll realize that AGI is the modern alchemy. Ironically, alchemy's penultimate goal was to construct a homoculus, which is essentially the goal of AGI. https://en.wikipedia.org/wiki/Homunculus#Alchemy "The a…

Penultimate means the second last thing in a set. In the alphabet, 'y' is the penultimate letter.

Re: When to assume neural networks can solve a problem

#28
post #19

Earlier quoted context omitted.

That's been the general vibe the popular tech press has been spouting for awhile. That NNs are somehow a major step towards AGI, which'll 'capture the lightcone of the future' to quote Sam Altman. At some point, we'll realize that AGI is the modern alchemy. Ironically, alchemy's penultimate goal was to construct a homoculus, which is essentially the goal of AGI. https://en.wikipedia.org/wiki/Homunculus#Alchemy "The a…

Penultimate means the second last thing in a set. In the alphabet, 'y' is the penultimate letter.

The last thing is 'profit'!

Re: When to assume neural networks can solve a problem

#29

it seems that neural networks have problem for computing the maximum function, and a human can compute the maximum easily, so it seems that the three heuristic rules don't work in this case. (1) https://datascience.stackexchange.com/questions/56676/can-ma...

That is untrue,

Here's a code example (actually took me ~20 minutes to get it "right" so I'll admit it's not the most trivial problem)... it includes seeds so that you can replicate locally (it should hit 100% accuracy all the time on the 1200 examples testing set reliably by about epoch 700):

'''

import torch import random from sklearn.metrics import accuracy_score

random.seed(61) torch.manual_seed(61)

X = [[random.random() for x in range(2)] for x in range(2000)] X_train = torch.FloatTensor(X[0:800]).cuda() X_test = torch.FloatTensor(X[800:]).cuda() X = torch.FloatTensor(X)

Y = [] for x in X: y = [0] * len(x) y[torch.argmax(x)] = 1 Y.append(y)

Y_train = torch.FloatTensor(Y[0:800]).cuda() Y_test = torch.FloatTensor(Y[800:]).cuda()

shape = [2,2] layers = [] for ind in range(len(shape) - 1): layers.append(torch.nn.Linear(shape[ind],shape[ind+1],bias=False))

net = torch.nn.Sequential(layers).cuda()

optim = torch.optim.SGD(net.parameters(), lr=1) criterion = torch.torch.nn.CrossEntropyLoss()

dataset = torch.utils.data.TensorDataset(X_train, Y_train) dataloader = torch.utils.data.DataLoader(dataset, shuffle=True, batch_size=10)

for i in range(pow(10,6)): for X,Y in dataloader: Yp = net(X) loss = criterion(Yp, Y.max(1).indices) loss.backward() optim.step() optim.zero_grad()

    if i > 500:
        optim = torch.optim.SGD(net.parameters(), lr=0.002)

    if i % 20 == 0:
        Yp = net(X_test)
        print('Training loss: ', loss.item())
        print(f'\nAccuracy score for epoch {i}:')
        print(accuracy_score(Yp.max(1).indices.tolist(),Y_test.max(1).indices.tolist()))
'''

This is as basic as you can get, predict the max out of 2 numbers, only uses a total of 4 node:

2 inputs (the 2 number) -> 2 outputs (the index of the maximum numbers). just 2 weight being optimize, no biases no nothing, as simple an implementation as you can get in terms of size.

There's also way to do it (apparently) where instead of treating it as "find the max index" you treat it as "output the maximum number": https://www.quora.com/Can-deep-neural-networks-learn-the-min...

But the approach I have will generalize to e.g. "Find the max of 5 or 100 or 1000 numbers" (although I assume it might take some time)

And overall you have no guarantee, that's why I qualified the statement and didn't say "Literally any imaginable problem that a human can solve without context".

To some extent it also matter how you encoder your number, you can train a 10000000000 parameter FCNN with RELU activations until the end of time to learn a simple mutliplication, and it won't be able to do so if you don't log encode your numbers or use some encoding or activation that means `` can be transposed in the `+` operations being done inside the nodes to combine the outputs... because that's outside of the scope of mathematics that given netwrok can do.

But, unless you are specifically trying to come up with an edge case and are instead looking at real world problems and trying to design the network in such a way as to best handle them (and this doesn't have to be all manual, you can use various NAS techniques), the rule will hold most of the time I believe.

Post reply on HN