/r/neuralnetworks

Photograph via snooOG

Subreddit about Artificial Neural Networks, Deep Learning and Machine Learning.

/r/neuralnetworks

26,576 Subscribers

1

Right model

So my task is to predict battery consumption on drone based on the previous values and next variables like speed and rotation of a motors.

I would use RNN, something like LSTM, to predict next values based on previous ones, but there is also another arguments that are dependent on battery consumption (motors rotation, position etc ...).

What model should I use?

1 Comment
2024/11/04
09:46 UTC

1

Improve quality of live video

I receive an analog video with a lot of noise and artifacts. Let’s say I ran this video through digital converter, but the quality still sucks. Is there any neural network that can remove noise and artifacts from live video without big delays?

1 Comment
2024/11/04
08:39 UTC

1

Robert Hecht-Nielsen Legacy

Robert Hecht-Nielsen taught a graduate sequence in artificial neural networks at UCSD in the late 80’s. Wonderful, foundational stuff. Bob was also a surfer and really wanted to embed some translation horsepower into his surfboard so he could interact with the dolphins. My path diverged from neural networks so not that much up to date. Here’s the thing, Bob had 386’s, you guys got betta stuff. It’s almost 2025, what no surfers out there?

0 Comments
2024/11/03
23:19 UTC

11

Haven't seen many images representing weights in trained networks. They are beautiful. This is mine.

2 Comments
2024/11/03
21:29 UTC

1

Genetic Algorithm over NN?

I've got a minimization problem:

  • I've got a reference function that is known, slow to compute and performs pretty well
  • I managed to approximate it very well with a simple NN
  • Now I want to make it better, because the reference function is known to have flaws

The issue is that I cannot tell if a single output of the function is good or not. I can only put it in a black box where it's used thousands of times and then get a performance score.

How would you handle this? I'm thinking about using a genetic algorithms on my NN but I'm not sure where to begin. I remember reading a paper about that a while ago but couldn't find it again.

I can also totally forget about my reference function and its NN approximation, in which case I'd be back to a standard minimzation problem, and I wonder if there's anything to do using NNs or if switching to classic minimization algorithm would be better.

0 Comments
2024/11/03
20:07 UTC

1

120 Dog Breeds, more than 10,000 Images: Deep Learning Tutorial for dogs classification 🐕‍🦺

https://preview.redd.it/htuma7v2aqyd1.jpg?width=1280&format=pjpg&auto=webp&s=1eb955978bdc315fcc5a58ef3696afd3a070080e

📽️ In our latest video tutorial, we will create a dog breed recognition model using the NasLarge pre-trained model 🚀 and a massive dataset featuring over 10,000 images of 120 unique dog breeds 📸.

What You'll Learn:

🔹 Data Preparation: We'll begin by downloading a dataset of of more than 20K Dogs images, neatly categorized into 120 classes. You'll learn how to load and preprocess the data using Python, OpenCV, and Numpy, ensuring it's perfectly ready for training.

🔹 CNN Architecture and the NAS model : We will use the Nas Large model , and customize it to our own needs.

🔹 Model Training: Harness the power of Tensorflow and Keras to define and train our custom CNN model based on Nas Large model . We'll configure the loss function, optimizer, and evaluation metrics to achieve optimal performance during training.

🔹 Predicting New Images: Watch as we put our pre-trained model to the test! We'll showcase how to use the model to make predictions on fresh, unseen dinosaur images, and witness the magic of AI in action.

 

Check out our tutorial here : https://youtu.be/vH1UVKwIhLo&list=UULFTiWJJhaH6BviSWKLJUM9sg

You can find the full code here : https://medium.com/p/b0008357e39c

You can find more tutorials, and join my newsletter here : https://eranfeit.net/

Enjoy

Eran

0 Comments
2024/11/03
18:16 UTC

1

Purpose of Embedding Layer in Neural Language Model

So I'm attending a lecture on Machine Learning and we are kind of covering what 3blue1brown covered in his video series about Large Language Models, that is, given a set of words, how do you predict the next word.

What confuses me is that the explanation on word embeddings and the implementation of word embeddings doesn't add up.

The explanation of word embedding: It's some higher dimensional space where words are mapped to vectors and these vectors still share some notion of meaning in that higher dimensional space. The explanation in the lecture showed graphics of words that are related to each other being closer in a cluster. The 3blue1brown explanation showed it by saying that the difference between vectors for man and woman are similar to king and queen, so you're able to do something that looks like math to get: queen = king - man + woman.

In other words, explanation of word embeddings claim that they capture semantic relationships!

However, when you actually implement embeddings, and not really implement but just use torch.nn.Embedding, all of that turns kind of useless and the purpose of the embedding layer becomes vague to me.

nn.Embedding gives you is basically a possibility to map integers to randomly initialized vectors. So what you are supposed to do is define a mapping between tokens and integers yourself, that could be a Python dictionary or you just use the text and index the words from 0 to end of your text and then claim that the same indices are in the Embedding.

What nn.Embedding essentially does is just create a matrix based on your vocab_size (number of tokens) and what higher dimension of embedding vectors you want to have. Then you are able to access each individual row of that matrix by passing in a Tensor with those indices.

In other words, implementation of word embeddings gives you just random, untrained vectors. Mapping is done by you.

It probably goes in the direction of you having to train the Embedding such that it becomes what was taught and what you typically find if you google 'word embedding.'

But if that's true, what exactly are we trying to accomplish by using an Embedding layer in a Neural Network?

Because if Embedding layer is untrained, it doesn't actually provide any benefit to the network itself. It's just literally a way of mapping text to vectors and nothing else. The weights of the Embedding layers adjust in a way such that whatever I try to accomplish with the network works. It doesn't mean the Embedding layer becomes this space of word vectors where similar words are closer to each other. Or will that still happen as a side effect?

0 Comments
2024/11/03
11:42 UTC

1

Oasis : Diffusion Transformer based model to generate playable video games

Oasis by decart and etched has been released which can output playable video games and user can perform actions like move, jump, inventory check, etc. This is not like GameNGen by Google which can only output gameplay videos (but can't be played). Check the demo and other details here : https://youtu.be/INsEs1sve9k

0 Comments
2024/11/02
09:55 UTC

4

Bias in NN

Hi all, I recently started to study neural networks. The concept that is causing me some confusion is that of bias. I understand what bias is used for in a neural network but I still don't understand two things:

  1. Does each unit in the various hidden layers have its own bias, or for each hidden layer is there a common bias for all units?

  2. I do not understand why in some cases the bias is represented through a unit, with its own weight attached. Shouldn't it be a paramenter and therefore not appear as a unit?

2 Comments
2024/10/31
12:03 UTC

2

How much normal ram would i need to just run this code

import torch
import torch.nn as nn

class TransformerBlock(nn.Module):
    def __init__(self, embed_size, heads, dropout, forward_expansion):
        super(TransformerBlock, self).__init__()
        self.attention = nn.MultiheadAttention(embed_dim=embed_size, num_heads=heads)
        self.norm1 = nn.LayerNorm(embed_size)
        self.norm2 = nn.LayerNorm(embed_size)
        self.feed_forward = nn.Sequential(
            nn.Linear(embed_size, forward_expansion * embed_size),
            nn.ReLU(),
            nn.Linear(forward_expansion * embed_size, embed_size)
        )
        self.dropout1 = nn.Dropout(dropout)
        self.dropout2 = nn.Dropout(dropout)

    def forward(self, x):
        attention = self.attention(x, x, x)[0]
        x = self.dropout1(self.norm1(attention + x))
        forward = self.feed_forward(x)
        out = self.dropout2(self.norm2(forward + x))
        return out

class ChatGPT(nn.Module):
    def __init__(self, embed_size, num_heads, num_layers, vocab_size, max_length, forward_expansion, dropout):
        super(ChatGPT, self).__init__()
        self.embed_size = embed_size
        self.word_embedding = nn.Embedding(vocab_size, embed_size)
        self.position_embedding = nn.Embedding(max_length, embed_size)
        self.transformer_blocks = nn.ModuleList(
            [TransformerBlock(embed_size, num_heads, dropout, forward_expansion) for _ in range(num_layers)]
        )
        self.fc_out = nn.Linear(embed_size, vocab_size)
        self.dropout = nn.Dropout(dropout)

    def forward(self, x):
        N, seq_length = x.shape
        positions = torch.arange(0, seq_length).expand(N, seq_length).to(x.device)
        out = self.dropout(self.word_embedding(x) + self.position_embedding(positions))

        for transformer in self.transformer_blocks:
            out = transformer(out)

        out = self.fc_out(out)
        return out

# Model hyperparameters for a large model (similar to GPT-3)
embed_size = 12288  # Embedding size for a large model
num_heads = 96  # Number of attention heads
num_layers = 96  # Number of transformer blocks
vocab_size = 50257  # Size of vocabulary (GPT-3 uses a larger vocab)
max_length = 2048  # Maximum length of input sequences
forward_expansion = 4  # Expansion factor for feed-forward layers
dropout = 0.1  # Dropout rate

# Initialize the model
model_0 = ChatGPT(embed_size, num_heads, num_layers, vocab_size, max_length, forward_expansion, dropout)

```

10 Comments
2024/10/30
15:41 UTC

1

Machine Learning Integration with Knowledge

0 Comments
2024/10/29
03:29 UTC

1

Combining DQNs

Which is the best way to combine 3 DQNs into one DQN. Each DQN has similar parameters, like they work on different tasks but still similar. For example lets say that we have a game with enemies and a state. First you can use 3 actions.

  1. Use sword
  2. Use bow
  3. Use magic

If you use sword you can use 2 different actions like light attack or heavy attach. If you use bow you can hit the enemy melee with it or use an arrow if you have etc
Instead of creating a DQN that can decide the first action (what kind of weapon will use) and then for each weapon decide what kind of action will make, I want to create for each weapon a DQN that knows exactly what to do with one weapon and then combine them into 1. The final network should understand from the state which weapon will use and what action will do with these weapons.

0 Comments
2024/10/28
12:42 UTC

1

Looking for collaborations on ongoing work-in-progress Full Papers targeting conferences like CVPR, ICML, etc.

Hey everyone,

Our group, Vision and Language Group, IIT Roorkee, recently got three workshop papers accepted at NeurIPS workshops! 🚀 We’ve also set up a website 👉 VLG, featuring other publications we’ve worked on, so our group is steadily building a portfolio in ML and AI research. Right now, we’re collaborating on several work-in-progress papers with the aim of full submissions to top conferences like CVPR and ICML.

That said, we have even more ideas we’re excited about. Still, a few of our main limitations have been access to proper guidance and funding for GPUs and APIs, which is crucial for experimenting and scaling some of our concepts. If you or your lab is interested in working together, we’d love to explore intersections in our fields of interest and any new ideas you might bring to the table!

If you have resources available or are interested in discussing potential collaborations, please feel free to reach out! Looking forward to connecting and building something impactful together! Here is the link for our Open Slack 👉 Open Slack

0 Comments
2024/10/27
08:09 UTC

1

What chairs are you guys using to code with?

I need a chair for my desk. What ones have you been happy with?

2 Comments
2024/10/25
23:01 UTC

3

Neural Networks making it adaptive?

  • I am currently a beginner student studying concepts of ANN, and can someone give me their input on my new research
  • Bond Formation:
    • Criteria for Formation: A new connection between two neurons is formed if it results in a significant reduction in the loss function (improving performance).
    • Implementation: Periodically evaluate potential connections between neurons that are not currently connected. If adding a connection between neuron iii and neuron jjj decreases the loss by more than a threshold ϵadd\epsilon_{\text{add}}ϵadd​, we add the connection.
  • Bond Breaking:
    • Criteria for Breaking: An existing connection is removed if it contributes little to the network's performance or if its removal doesn't significantly increase the loss function.
    • Implementation: Monitor the weights of existing connections. If the absolute value of a weight wijw_{ij}wij​ falls below a threshold ϵremove\epsilon_{\text{remove}}ϵremove​, or if the connection's contribution to performance is minimal, we remove the connection.
1 Comment
2024/10/24
17:10 UTC

1

Please suggest me a course that I can follow to learn how to train a neural network with a specific language,made of aggregated parameters...

Hello to everybody.

I think that the times are mature to start investigating how the neural networks can help the system admins,in the specific case the FreeBSD system admins,since I like to play with FreeBSD more than any other OS ; more than Linux,yes. But that's not the point.

Basically I would like to try to train a neural network with a set of bhyve commands so that it will be able to predict and understand what you want to do from an input text. I have liked virtualization since my youngest ages. And I like bhyve very much.

In these 3 years of hard work trying to learn how to administer FreeBSD,I've spent a lot of time on bhyve.

To know bhyve has been the first reason that brought me to play with FreeBSD. I'm also curious to study the deep learning and neural networks,because I think that in the next future,these technologies will be integrated within the Operating systems at a low level....

With that said,I would like that you point me to the right course,because I want to learn how to train a neural network with the special language needed by the bhyve hypervisor so that the network can predict what the user wants to do,which bhyve commands and parameters he/she wants to "give" to bhyve.

Very thanks.

0 Comments
2024/10/24
12:06 UTC

1

Abducing domain relationships in scene graphs for VQA

0 Comments
2024/10/22
12:31 UTC

5

Theory Behind Basic Text Classification Neural Network Explained (Building Spam Detector)

3 Comments
2024/10/21
15:58 UTC

2

MSE help

Hi everyone, I was just working on a basic neural network in C++ and I was using mean squared error to compute the cost over multiple training examples. When finding the derivative of cost with respect to the output node value, I noticed the derivative will always be positive if you plug in the average cost, so I was wondering how the NN know which direction to nudge the weights. I can get the network to match one training example but as soon as I add 2 the output is significantly off. Sorry if this is a dumb question as I am very new to this and don’t know much calculus. Thanks!

1 Comment
2024/10/21
04:42 UTC

3

Easy Coin Detection with Python and OpenCV

https://preview.redd.it/cjusqueiqyvd1.jpg?width=1280&format=pjpg&auto=webp&s=853c718f2f0a7ea0f13d421342572d724ed05bce

How to detect and count coins in an image using Python and OpenCV?

 

In this tutorial, we'll walk you through the step-by-step process of using image processing techniques to identify coins in an image, sort them by size, and mark each coin with a corresponding number.

 

We'll start by converting the image to grayscale and applying a blur to help filter out noise.

Then, we'll use the Canny function to detect edges and find contours around each of the coins.

 

After sorting the detected areas, we'll loop through each one and display a circle around or inside it.

 

This tutorial is based on Python and OpenCV. 

 

You can find more similar tutorials in my blog posts page here : https://eranfeit.net/blog/

 

check out our video here : https://youtu.be/_Coth4YESzk&list=UULFTiWJJhaH6BviSWKLJUM9sg

 

 

Enjoy,

Eran

0 Comments
2024/10/20
19:30 UTC

2

Need resources to learn the basics of neural network modeling with pytorch. Assume I'm stupid.

I need to learn pytorch and neural network modeling for a current research project.

I have had a interest in computational neuroscience and machine learning for a while, and know some of the fundamental concepts, just not versed in building or designing them.

Ideally I'd like to be on a level where I can implement some basic learning rules for RNN's with some specific parameters for biophysical/ functional realism by February of next year. My semester ends in December, and I have about 3 and a half weeks to get a running start before my spring semester starts.

I am a bit of a dummy and tend to be distracted, so something that is dummy friendly would be nice.

Would you guys recommend any YouTube playlists/ coursera courses, podcasts, or general online resources?

2 Comments
2024/10/19
19:23 UTC

1

Help understanding crossover in Genetic Algorithm

I'm on a quest to understand various algorithm and I need help for the crossover part when dealing with genetic algorithm.

Let's say I use a simple neural network with the structure Input layer --> hidden layer 1 --> hidden layer 2 --> Output layer. From what I understand of the genetic algorithm, at each generation n, I recombine the best agents (by mixing their respective weights) together to create generation n+1.

However, I don't understand how combining the weights of two different agents is supposed to produce a possibly more performant offspring. It will just make the offspring behave completely diffently from the parents right? I can't see the difference between :

  • keeping exact replica of the best performer at each generation and filling this generation with offspring from the bests ;
  • Keeping exact replica of the best performer and filling the rest with entirely new random agents

If someone can enlighten me on the matter, it would be really appreciated :-)

5 Comments
2024/10/19
13:34 UTC

4

help me find the right neural network.

Hello, friends. I'm facing a search problem. Need a neural network that improves pictures based on generation. Here are before and after examples.

before

after

1 Comment
2024/10/19
11:05 UTC

0

Need help with neural net

Can someone help me with my neural net? I’d honestly pay you if you could call me or zoom me lol

2 Comments
2024/10/19
00:29 UTC

2

Best neural network architecture for multiple-sense AI?

I am thinking on creating a simple AI engine in C, based on a really cloudy idea that I have multiple buffers that can be used as streams for I/O, accessed & controlled by a neural network. The buffers contain a unique identifier, so the neural network knows what purpose the buffers serve, and the neural network is activated in a loop, to simulate a "constantly-thinking" AI.

What's the best type of neural network architecture to implement for this? A FNN, RNN, or what? I plan on the number of buffers being dynamic, so a more dynamic neural network type would be preferred, and not something like a transformer neural network.

1 Comment
2024/10/17
19:42 UTC

Back To Top