#data-science-and-ml
1 messages · Page 147 of 1
All mean majority part of ai/ml like 70 to 90 percent
And 1 more thing can i learn ai / ml and web scraping / flask / djanago, fastapi means stuff related to web
And is learning those 2 both does help me?
Help you what? Learning anything with concrete uses can help you. People didn't design those tools just to be wastes of time and electricity
Can my car help me? Well, depends. Am I trying to drive somewhere, or am I trying to hike up a mountain? I dont think my car will help me hike a mountain
You're asking very vague questions. You should be able to figure out if something will provide use to you
f = x * y + x / y
In pytorch, how do I get the gradients of the multiplication and division here? Preferably without defining them separately and also without using retain_grad. I'd like to use a hook. I know that works for nn:modules for some reason but for this is doesn't.
I just want all the intermediate gradients. 🙂
Yes. You might need to define x and y with requires grad, though
(Pdb) x = torch.tensor([[1.0, 2.0]])
(Pdb) y = torch.tensor([[3.0,4.0,5.0,6.0],[3.0,4.0,5.0,6.0]])
(Pdb) torch.matmul(x,y)
tensor([[ 9., 12., 15., 18.]])
(Pdb) torch.matmul(x.T,y)
How does pytorch know the representation of x? Could be a row vector, could be a column vecotr no? I assume they just look at the shapes and just transpose one of them?
the way you defined it is not ambiguous, it's a row vector
x= torch.tensor([[1.0],[2.0]])`
this is a column vector
As gabiga said, they're not ambiguous. It might be ambiguous to you, but there's specific syntax. They would never auto transpose. You're responsible for dimensional compatibility, as it should be.
I have a simple question with a no doubt complicated answer
How do I detect a vanish or exploding gradient, why do they occur (not as a matter of math, but as a matter of architectural choices), and what do I do about them?
ah actually true thank you
the gradient vanishes because it gets smaller and smaller and at some point surpases what your computer can "display". it can only display numbers in a certain range, so at some point it's just basically -inf.
You can battle it by clipping your values.
simple example: a single layer rnn, with just 1 weight w.
assume w is say 2, and we run it for 100 days. the value we get at the end is input * 2^100, and this huge value will make its way into our gradients, making them "explode"
assume w is say 0.5, run it for 100 days again. the value at the end is input * 0.5^100, which is tiny, and makes the gradients also tiny, thus "vanishing"
and single layer rnn is the same as 100 layer perceptron
sigmoid has vanishing gradient
relu not as much and generally shallower networks have it less
with batch norm or other types of norm you get less of it
or some fancy initialization like LSUV or orthogonal
what is the minimum number of layers a CNN can have?
what is minimum number of layers a NN can have? what do you think?
2 right? input and output. so a CNN has 3 minimum because of the convolutionary layer?
2 layers??
input , output?
then where is hidden layer?
how will your NN will learn about data then?
so there is a minimum of 3 layers for the most simple NN?
you can say that!
well is it the same for a CNN?
so a CNN is just -> convolutional layer + NN
why conv layers?
to extract more features from data ( typically images )
and then this extracted features will gets converted into 1D tensor ( matrix )
and this tensor willl get feed into Input layer of NN
understood?
like this, here feature learning is CNN and classification is NN
isn’t this more than 3 layers?
the conv layers are separated from NN
so you can add more than 1 conv layers
but the minimum is 3 right
read this
for NN yes!
I'm trying to understand the relationship between problem complexity and gradient collapse
I've learned - by banging by head against the desk for a few days - that exploding or vanishing gradients are largely a symptom of too large a network applied to too simple a problem. Fair enough. I'm trying to understand the exact nature of why a more complex problem prevents gradient collapse within more complex networks. This is what ChatGTP said about the matter:
"More complex tasks provide richer and more structured information that helps deeper networks stabilize and perform well. Complex problems have multiple layers of abstraction, more diverse data, and rich error gradients, which allow the network to avoid issues like vanishing gradients or collapsing, especially when using architectures designed to support deep learning."
Would y'all say this is correct?
hello, im wanting to get into ai, i have past experience with c++ and c# for software/game development with basic knowledge of python, im wondering what's the best way to start learning about machine/deep learning and what pre-requisites i need before i try learning about it, like what math, tools besides a python ide (pytorch, tensorflow, etc.) and whatever else i need to know
just looked through pinned mb xd but please let me know of anything else by all means
its starting to look better, but now everything is in black and white. Ill see how more training goes.
yes an input , convolutional and output layer
Here's an example of what mine looks like ```class TokenImageCNN(nn.Module):
def init(self, embedding_dim, output_dim, h_prime, w_prime, c_prime):
super(TokenImageCNN, self).init()
self.embedding_dim = embedding_dim
self.h_prime = h_prime
self.w_prime = w_prime
self.c_prime = c_prime
self.output_dim = output_dim
self.projection = nn.Linear(embedding_dim, h_prime * w_prime * c_prime)
# Convolutional layers
self.conv1 = nn.Conv2d(
in_channels=c_prime, out_channels=64, kernel_size=3, padding=1
)
self.bn1 = nn.BatchNorm2d(64)
self.pool1 = nn.MaxPool2d(kernel_size=2, stride=2)
self.conv2 = nn.Conv2d(
in_channels=64, out_channels=128, kernel_size=3, padding=1
)
self.bn2 = nn.BatchNorm2d(128)
self.pool2 = nn.MaxPool2d(kernel_size=2, stride=2)
self.conv3 = nn.Conv2d(
in_channels=128, out_channels=256, kernel_size=3, padding=1
)
self.bn3 = nn.BatchNorm2d(256)
self.pool3 = nn.MaxPool2d(kernel_size=2, stride=2)
self.fc1 = nn.Linear(256 * (h_prime // 8) * (w_prime // 8), 1024)
self.fc2 = nn.Linear(1024, output_dim)
def forward(self, token_embeddings):
# Project token embeddings into image-like structure
projected_embeddings = self.projection(token_embeddings)
projected_embeddings = projected_embeddings.view(
-1, self.c_prime, self.h_prime, self.w_prime
)
# Apply convolutional layers
x = F.relu(self.bn1(self.conv1(projected_embeddings)))
x = self.pool1(x)
x = F.relu(self.bn2(self.conv2(x)))
x = self.pool2(x)
x = F.relu(self.bn3(self.conv3(x)))
x = self.pool3(x)
# Flatten and apply fully connected layers
x = x.view(x.size(0), -1)
x = F.relu(self.fc1(x))
x = self.fc2(x)
return x```
Hi everybody. Would somebody maybe know how to detect the horizontal lines, how many there are, and how much in y are the gaps. I ploted here np.sort(np.diff(sin^2(chi))) vs index. chi is discrete, delta chi = 10deg, 36 x. That reaveals the steps.
You want to identify runs where the lag values are identical to current value?
I would like to know how many flat parts there are reliably.
Here: I split 360deg in 36 segments a 10deg=delta_chi. That should give me 9 flat sections
But within those flat segments there is some tolerance and the distance between each flat section separates them clearly.
Yes, the trick is to label the data first for whether the value equals previous value, then you can group by the cumsum of every transition (not equals)
N other words, identify all the points where it's -not- a run. Then count those. If you just want a count, then you could count all of those where the gaps between them are larger than 1
If you want to work this out, you can open a help thread: start with code with an example dataframe and we can show you how
I don't understand. Sorry If I may: It gets harder, when I split 360deg in delta_chi=1deg steps. Then I would still get the flat segments , way more, but with a different spacing on the y-axis between them. I would like to identify this dynamically, no matter in how many segments I split my circle.
Start a help thread with code for an example data set
Ok, I try this.
One last thing: I tried it with DBSCAN, it works , but still it is akward to find the right tolerance automatically
Done
def loss(self, recon: torch.Tensor, batch: torch.Tensor, mu: torch.Tensor, lv: torch.Tensor):
rc_loss = nn.functional.mse_loss(recon, batch, reduction='sum')
kl_loss = torch.sum(1 + lv - mu.pow(2) - lv.exp()) * -0.5
rc_mean = rc_loss.mean()
kl_mean = kl_loss.mean()
rc_std = rc_loss.std()
kl_std = kl_loss.std()
rc_loss = (rc_loss - rc_mean) / (rc_std + 1e-9)
kl_loss = (kl_loss - kl_mean) / (kl_std + 1e-9)
return rc_loss + kl_loss
I'm trying to find a simple way of normalizing the losses from different sources such that they are within more or less the same frame of reference
If the losses aren't bounded in any meaningful way, subtract from each its sample mean, and divide each by its sample standard deviation
Standard data analysis technique: it rescaled everything to units of "standard deviations away from the mean"
oh, I see that's what you're doing, with a correction for 0 standard deviation
when std dev is 0 just bypass division and set loss to 0: there is only one value, so that value is the mean, so the result is just 0 after subtracting the mean
you're doing a kind of supervised autoencoder? trying to balance reconstruction loss with classification loss?
Yeah - mostly for practice at this point. As I understand it, adversarial "real or fake" classification can work wonders for image quality. I'm just practicing on MNIST digits right now but I'm going to scale up once I get all this figured out
As you say, the rescaling approach is probably simple and easy, but it's giving me trouble. Some kind of nan in rc_loss - and I can't even fathom where it's coming from
My weights are initialized with Xavier, and my layers are all pretty standard
def __init__(self) -> None:
super(VAE, self).__init__()
self.dsize = nn.Upsample(scale_factor=0.5, mode='bilinear', align_corners=True)
self.usize = nn.Upsample(scale_factor=2.0, mode='bilinear', align_corners=True)
self.funct = nn.ReLU()
self.noise = nn.Dropout(0.00)
self.conv1 = nn.Conv2d(1, 16, kernel_size=3, stride=1, padding=1)
self.norm1 = nn.BatchNorm2d(num_features=16)
self.conv2 = nn.Conv2d(16, 64, kernel_size=3, stride=1, padding=1)
self.norm2 = nn.BatchNorm2d(num_features=64)
self.conv3 = nn.Conv2d(64, 256, kernel_size=3, stride=1, padding=1)
self.norm3 = nn.BatchNorm2d(num_features=256)
self.mu = nn.Linear(4096, 4096)
self.lv = nn.Linear(4096, 4096)
self.deco1 = nn.Conv2d(256, 64, kernel_size=3, stride=1, padding=1)
self.deno1 = nn.BatchNorm2d(num_features=64)
self.deco2 = nn.Conv2d(64, 16, kernel_size=3, stride=1, padding=1)
self.deno2 = nn.BatchNorm2d(num_features=16)
self.deco3 = nn.Conv2d(16, 1, kernel_size=3, stride=1, padding=1)
def forward(self, x: torch.Tensor) -> torch.Tensor:
x = self.dsize(self.noise(self.funct(self.norm1(self.conv1(x)))))
x = self.dsize(self.noise(self.funct(self.norm2(self.conv2(x)))))
x = self.dsize(self.noise(self.funct(self.norm3(self.conv3(x)))))
x = x.view(x.size(0), -1)
mu = self.mu(x)
lv = self.lv(x)
x = x.view(-1, 256, 4, 4)
x = self.noise(self.funct(self.deno1(self.deco1(self.usize(x)))))
x = self.noise(self.funct(self.deno2(self.deco2(self.usize(x)))))
x = self.deco3(self.usize(x))
return torch.sigmoid(x), mu, lv
Do you have a bug somewhere further up the pipeline?
I just recently fixed a bug caused by numerical instability leading to NaN that occurred ~20 lines of code above the actual error site
I'd like to run a possible normalization strategy by y'all. The above didn't really work even after fixing the error
MSE has a maximum possible value, and a discriminator can be made to output probabilities of real vs fake between 0 and 1. This should normalize the two values such that all I need to control is the weights as hyperparameters.
Sane?
Does a 4090 make training ml models faster
Doing multiple operations in parallel at the same time is faster than doing each of them sequentially one at a time, and GPUs allow for you to perform many operations which ml models require in parallel, so yes, if used correctly GPUs can be orders of magnitude faster than CPUs
That said, you have to setup and configure multiple things, and it will only make specific operations faster. It's not a magic plug-and-play device that will make everything faster, but it is effectively a prerequisite for training huge neural networks
as for talking about "a 4090" in particular, depends on what you're using as a reference.
If you compare it with using a CPU, the difference can be of orders of magnitude
If you compare it with a slightly weaker GPU of the same manufacturer, the different isn't going to be that huge
If you compare it with a stronger GPU, it'll be weaker
Well then my hyperparameter optimization is taking like 5 minutes per trial so I dont even want to know how long it'd take without one. I'm really putting it to work though, it was super fast for small example problems
make sure that you're actually using it - again, you must set it up for it to work at all, and some libraries don't benefit from it
Hey guys, I'm trying to get into ML and I've got a lot of questions. I'd say I'm very proficient with Python, but I'm a complete newbie when it comes to this stuff. Sorry if I sound a bit vague here and there, as the exact details of the project are confidential.
I'm trying to build something where I can input an image of a face (from a frame of a webcam) and get back a certain kind of text response. I've already scraped 90k pairs of image urls of faces and text from online. When I input an image of a person, I want the model to give me back a response based on the data that I've given it. As in, I want the model to give me a response in the same style/tone as the rest of the data I've given it.
I know I'm supposed to use RAG, which I found a few tutorials online for. But how do I go about this for images? Do I use an existing model to come up with a description of facial features for each image that I have, and then store it in a vector database as text? Or is there a way I could directly put these images inside a vector database? Then how do I connect my LLM (Ollama) to that database? Are there any other important details I'm missing?
I also have no clue where to start- how do I get my giant csv of data into a vector database? What vector database do I use? Any advice would be greatly appreciated
You can do this with an advanced RAG using a multimodal retriever and a vector DB, I like elasticsearch. You can embedded images, text, tables, etc. You would just need and embedding model for images but you can process it
what exactly is a multimodal retriever? and wdym by embedded images and text?
sorry i'm new to all this stuff
Im got the quantum embeddings going and boy did this thing slow down lol. Only 185 hrs for 1st epoch. Im only using a batch of 4 too. I threw in some temporal cross-modal fusion to spice it up. Some other things, think i over did it.
Check out encoding also with like BERT models or sentence transformers for text and look for image models too,https://docs.haystack.deepset.ai/docs/retrievers
I don’t really know where to start, how do I start making embeddings and putting them in my vector db? And should I go the route of storing images or text descriptions of the image?
And how would I make it so that it retrieves text using the image, and not the other way around
The compression rationm is 588x the input data lol
I can help you, though Ive only used elasticsearch for vector db. But check out the models first I'd start there, check out BERT and sentence transformers for encoding embeddding data
Will do. It’s almost 1am rn but I’ll check it out tomorrow, ty 🙏
no worries, later
Hello,
I'm writing my own tensor subclass to implement some functionality for research. Basically I want to overwrite reduction behaviour e.g. the mean in the cross entropy loss or the summation in matrix multiplication.
I can achieve a lot of that with those tensor subclasses written in python but there's also e.g. Tensor::sum() on the C++ level which I think I might not be able to overwrite with a subclass.
Question 1: Can I overwrite Tensor::sum() on the C++ level with a tensor subclass?
Question 2: Can I overwrite it on a C++ level?
what do you want to rewrite these for?
Many popular feature-attribution methods for interpreting deep neural networks rely on computing the gradients of a model's output with respect to its inputs. While these methods can indicate which input features may be important for the model's prediction, they reveal little about the inner workings of the model itself. In this paper, we observ...
Imagine you have a node with 4 incoming edges. Backprop would sum it up but maybe you are curious about: Which one of those 4 edges has the highest or lowest gradient? Or how is the gradient distributed over those edges? stuff like that. So you overwrite the summation to e.g. only consider the max. value or whatever you wanna do.
a first, unrelated, observation is that this doesn't seem to be published anywhere with peer review, so proceed with caution
it is I just gave you arxiv because free
but yeah this basically requires you to write your own differentiation engine or fish out the intermediate results from the standard ones
google scholar doesn't show it being published anywhere reputable, but maybe you have access to something private i somehow missed ACL, smh
you can modify the backend code and compile your own custom module based on that, yes
but i would stop and wonder if this is something you want to use long term and/or possibly make public, or if it's just to test some preliminary results for research
in the latter case you can sidestep all of this by building the custom functions directly on top of pytorch or jax and just relying on the JIT
this requires going kinda in depth into the packaging and distribution of the module you're modifying to see how it's linked to the backend
Yes, as I said, most of it can be achieved with tensor subclasses. I'm just wondering if I can overwrite things like Tensor::sum() as well as in if someone uses the C++ API, it takes what I overwrote in the subclass as well.
The thing is that we basically hook into the dispatcher but that doesn't matter if I wanna overwrite something using the C++ API
yeah but you'd have to recompile and link the module
that would replace the functions everywhere in the module, which may or may not be what you want
Yeah, still trying to figure out everything because there are so many moving parts. But I have a pretty good idea now I think.
this probably isn't something you really want to do though... these backends are usually BLAS-like
with a matrix multiplication function defined separately for almost any case you could think of. different precisions, real, complex, transposed, symmetric, hermitian, etc
so even modifying matrix multiplication might require modifying some 20 functions (depending on the specific backend)
yes
might be worthwhile to see which backends are compatible with the module you're using, see which one is the least problematic to fiddle with, and go with that
you would also have to distribute your module along with the backend, so i guess some reading about licensing is in order
yes I already did a lot of research into it, the question really was just about if pytorch provides way to overload methods like sum etc. 🙂
I'm fully aware that e.g. matmul gets dispatched to cuBLAS which is even closed source. I currently just overwrite it for a specific usecase and use a basic naive implementation. To make it go fast, you'd have to write your custom kernel. I'm completely aware of all that.
I just noticed yesterday that I might be able to save a lot of work if I might overwrite some of the basic reduction oeprations on the C++ level. I read the code for the autograd engine ages ago but never looked into how PyTorch is exntesible on the C++ level.
Is it possible for the inpainting model to ignore certain parts of the image when making predictions?For example, I have a picture like this. While inpainting certain parts of this image, I want black pixels not to be used when making predictions. Is this possible?
this is LaMa inpainting model output:
What sort of diagnostics can I do upon a neural model in order to get a better idea of the health of the activation and gradient flow?
who have worked here on CTGAN ?
Hi guys, hope you are doing great!
I'm having a big question. I've been working on a machine learning project about Customer Segmentation (RFM analysis), after cleaning, feature engineering, analysing, and more, I can't find clusters in the data, like all the samples are divided in only one group... Any recommendation on what to do? 😅
Thanks in advance guys!
Hello, remember to always ask your actual question. never ask if someone knows about the topic and wait.
import pygrib
import eccodes
import tempfile
import os
ds = pygrib.open('Tools/merged.grib')
with tempfile.NamedTemporaryFile(delete=False) as temp_file:
temp_file_name = temp_file.name
for msg in ds:
with open('Tools/merged.grib', 'rb') as in_grib:
gid = eccodes.codes_grib_new_from_file(in_grib)
eccodes.codes_write(gid, temp_file)
eccodes.codes_release(gid)
h123 = ds.select(step=120)
for msg in h123:
values = msg.values
new_values = values / 2
gid = eccodes.codes_new_from_message(msg.tostring())
eccodes.codes_set(gid, 'step', 121)
eccodes.codes_set_values(gid, new_values.flatten())
eccodes.codes_write(gid, temp_file)
eccodes.codes_release(gid)
with open('Tools/merged_modified.grib', 'wb') as outfile:
with open(temp_file_name, 'rb') as infile:
while (gid := eccodes.codes_grib_new_from_file(infile)):
eccodes.codes_write(gid, outfile)
eccodes.codes_release(gid)
os.remove(temp_file_name)
ds.close()
in the output, theres a new time1 dimension that is replacing time when time is the dim that takes the new modified values, i have no idea what to do, searched all over internet/Ai and everything and asked but got 0 answers anywhere
1
which is 1 convolutional layer
for example it can learn to apply some filter
seems like its finally starting to work. I've never seen the images with so much noise. reminds me of the white noise from tv's back in the day.
What are you making?
he is mad scientist!
I’m tryinng to build this multimodal model that blends images and text in a way you don’t usually see. I’m mixing things like VQ, CLIP, BLIP, diffusion, and this token image CNN I built. The CNN takes the token embeddings from the text and projects them into an image-like structure, then I’m using attention mechanisms to fuse both the images and text at different levels. It’s kind of like merging both modalities in a more dynamic and layered way... thats hopefully the idea annyways 🙂
and what's the usecase?
Perhaps you can include that entire black part into the inpainting mask, and then just don't use that part of the inpainted area?
So the main idea behind it all is to make image generation from text more expressive and controllable., Im thinking for example you can throw in a complex prompt with multiple objects, attributes , etc to try to capture more of the semantic relationship between text and images. Hopefully you can even refine those images by tweaking the text, trying to iteratively improve what it creates.. Maybe even a type of image captioning system or visual question answering too. But who knows man, it's all still pretty experimental at this point.
do you think BERT is best for my use case?
i read through the article, and i have a general idea of how it all works, but I'm not really sure where or how to start working on it
i don't really know what steps and what order i need to take to develop a model like that using BERT
I'm trying to find a way to normalize different components of loss functions so they're easier to optimize, and, offer better control over which loss function (goal) should take precedence at a given time
I'm building a VAE system with a twist - multiple specialized encoders. To do this I'll need various loss functions. Reconstruction loss of course, strong coupled with adversarial loss to enhance image quality. Training individual encoders also requires contrastive learning loss, and ensuring there is no overlap between the encoders requires some dientanglement pressure
In the interest of sanity, I've settled on normalizing all losses to between 0 and 1 (then muliplying each by 100 to prevent gradient collapse)
I figure I can express MSE loss between 0 and 1 by dividing the loss by its maximum possible value (for an image of a given size). The various adversarial losses are sigmoided on output, so they're already between 0 and 1.
The only thing I'm a bit fuzzy on is normalizing contrastive loss - this measures the distance between two encodings. I'm thinking I can use the average of the cosine distance between the encodings and the ratio of their magnitudes. This should reflect differences in both direction and magnitude equally while also staying within 0 and 1
And yes, I know this is all a bit weird. Multioptimization of different loss components is an open question right now, and it makes things much more orderly in my mind to normalize everything, then worry about weights separately. I havn't forgotten that different components of the loss will need different emphases at different times.
Not enough information to help you. What kind of clustering algorithm are you using? Tell us more about your data - number of variables, total sample etc
The plan to normalize the contrastive loss sounds solid. I pretty much follow the same route for normalizing from 0 - 1 For the reconstruction loss its mse based. I have dynamic weights also but ive been brainstorming how to optimize it for the clip loss, i was thinking maybe thresholds and possible epochs but i'd rather stay away from it. This is what I got for my diffusion loss. You gave me a few ideas though.
max_mse_value = img_size[0] * img_size[1] * data_range ** 2
mse_loss = F.mse_loss(x_recon, noise)
normalized_mse_loss = mse_loss / max_mse_value
return normalized_mse_loss * 100 ```
Did you check out the vector databases? What were you doing exactly again? lol
What about EMA for dynamic weights?
Very cool project
thanks dude!
EMA?
I was thinking of writing a recurrent attentive system with a delayed reward to control hyperparameters
Something which learns to recognize short and long term patterns in learning rates and changes in hyper parameters, and which has a selective attention based memory that only hangs on to what it thinks is important
Also, I'm glad to see I'm not the only one whose thought of normalizing learning. You even multiply by 100, which is what I was planning on doing!
i did, but i don't really know what to use to generate embeddings and store them in a vector db
Exponential moving average. Try the recurrent attenntive system, sound like a really good idea.
ive made some changes and my metrics are looking a lot better and the reconstructions are coming in clearer.
hey what about a multi agent with dynamic weight assigment? You can have multi agents for like spatial, temporal, dense, etc , You can agents handling different aspects. Each agent focuses on a X features in your data, then the system to adjust how much each agent contributes.
kinda confused on how to start my project
Remind me again of your goal. Sorry,.
nevermind i see it up above, im gonna read it agian
I see, I would suggest a CLIP model. You can use it to embed the text and images into the vector space
infact, see if you can get the sentence-transformer clip model to work and tell tell me how you did it, lol
hmm okay
i looked up CLIP model and this is what i found "So, for example, an image of a dog and the sentence “an image of a dog” would end up having very similar embeddings and be close to each other in the vector space."
this isn't exactly what i'm looking for though, the text i'm saving with the image doesn't necessarily describe the image
the text kinda refers to the person's face, but its its own thing
essentially I want to use an image of someone to look up a similar image in the vector database, then use the text thats paired with it
even if the image and the text aren't directly related
Then just use a sentence transformer for the text and something like facenet
just remember to match the output dims of the models
I mean theres ways to get around it, but it would be easier to make
sorry get around what?
and so i just need to store these embeddings in a vector database? in what structure do i store it? i'm new to vector databases as well
I should do a kaggle comp
Hey everyone I'm new to open ai APIs and I was testing it last day, it started to say insufficient token add billing address, can you guys tell me how much will I have to spend I'm a student so the budget is tight and I wanna learn and play with the api
i dont really understand what this repo is, is just the code they used to train it?
how do i actually use this model
also what’s a sentence transformer
I gave all pixels outside the polygon an intensity value of 150, but I don't know how to ensure that the model does not use these pixels when processing.
Since my goal is to create an empty room, the floor needs to return to its original state. there should be no distortions
I separated all parts of the room into polygons ( floor, walls, ceiling).
In this way, the layout of the room will not be disturbed while inpainting
What I mean is: instead of having the model inpaint only the polygon, you can inpaint the polygon and the outside pixels, and then replace the outside pixels with the ones from the original image. (Though it's not very clear to me whether there'll be anything left, in such a case - do you only have 2 segments to the image?)
i separated the image into 5 different polygons. With your method I have to combine all the images to complete the pixels outside the polygon. i think this does not solve the problem because other images also need this inpaint process. but thanks for your advice
When I give the pixels with a value of 150 the value "nan" in the mask, the shape is preserved, but the pattern of the ground is still not what I want.
Hello 👋 I'm training and autoencoder on signal data using LSTMs for anomaly detection.
For normalization I'm using sklearn.StandardScaler. For . fit(), should I only pass in the cleaned data without any deviating signals or the entire data?
Can someone give me a nice neural network that's as simple as possible but does something? Can be made up but actually needs to learn whatever. Should only have like a dozen or so nodes in total.
The ones at https://playground.tensorflow.org/ come to mind
A machine learning craftsmanship blog.
That's a really cool toy/demo
Okay thats actually impressive as hell.
I let it run last night till this morning
that tensorflow playground is pretty wicked.
Guys i wanna automate Arithmetic progression
Example if you wanna find n (number of terms)
But you have only last term and first term
And any random term
You have to make new formula
Another example, you wanna find d and you only know sum and and last term
Then New formula you have to use
And to make this python program complete you have to write logic for all 87 trillion
So your program can work in any possible states
And that possible states 87,178,334,440 that take million of years to implement in your program,
So the only solution you left with train ai for this Arithmetic progression
The ai will generate formulas on the spot instead of storing them all
My question : is simple Ai model can automate whole Arithmetic progression?
So, I've built a little VAE to reproduce MNIST digits. It's converged pretty well, it can replicate the general shape of the digit just fine
But the edges are a bit blurry. Of course there's a limit to how detailed a VAE can get - but I wonder if this is because the final layer has kernel size 3x3
Does this mean the pixels are being set multiple times as the deconvolution slides across the layer above? If so, is there some way to add a final layer with kernel size 1x1 such that every pixel is set only once?
Or, is that functionally equivalent to what's already happening?
i'm not sure i understand what you mean. are you given the terms a_1, a_N, and some a_n in between them, but not what n and N are?
!paste
If your code is too long to fit in a codeblock in Discord, you can paste your code here:
https://paste.pythondiscord.com/
After pasting your code, save it by clicking the Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.
Bro you know Arithmetic progression?
if you have n or N, this is pretty trivial. if you don't, then it can have either infinitely many sols or none, depending on how you choose your n and N
in either case, you don't need ML for this
That's just a example
I made a little something you can play around with. https://paste.pythondiscord.com/KGQQ
im training something else so i can check it out right now though
Is it work for all 87 trillion states
There can be 87 trillion formulas jn arithmetic progression
lol no
You should debug it !
seems to me as a bruteforcing mechanism
u want to use ai to have a filterset for less iteration requirement?
I have got the YOLOV8 Nano model in the onnx format, how can I convert it to Tf lite?
I need help designing a transformer model.
Given:
- Vocab: Number from 1 to 20.
- Input: Sequence of 10 numbers
Task: Does the first number on our list of 10 numbers show up again?
E.g. [1,2,3,4,5,6,7,8,9,1] -> Yes, [1,2,3,4,5,6,7,8,9,20] -> No
I want to overfit a model to it, such that I get 100% accuracy (assuming a balanced dataset).
I want the model to be as simple as possible but I can't figure out anything that actually trains. I'm currently trying this:
# Simple Transformer with an Attention Head for First Token Repeated Once Task
class SimpleTransformer(nn.Module):
def __init__(self, vocab_size, hidden_size, num_heads, num_layers, ffn_size):
super(SimpleTransformer, self).__init__()
self.embedding = nn.Embedding(vocab_size, hidden_size)
encoder_layer = nn.TransformerEncoderLayer(
d_model=hidden_size,
nhead=num_heads,
dim_feedforward=ffn_size,
activation="relu",
)
self.transformer = nn.TransformerEncoder(encoder_layer, num_layers=num_layers)
self.fc = nn.Linear(hidden_size, 1)
def forward(self, x):
embedded = self.embedding(x) # Embedding layer
transformer_out = self.transformer(embedded) # Transformer Encoder
# We care only about the first token's output for the task
first_token_output = transformer_out[
:, 0, :
] # Select the first token across the batch
out = torch.sigmoid(
self.fc(first_token_output)
) # Apply sigmoid to the first token
return out
I generate 10k samples and use
vocab_size = 20
seq_length = 10
hidden_size = 128
num_heads = 1
num_layers = 2
ffn_size = 256
batch_size = 64
lr = 0.05
num_epochs = 100
Any LM expert here who might see something obviously wrong?
e.g. I'm actually unsure about the sigmoid.
can you share your metrics plots?
I have no plots, it literally just stay more or less at the same loss/accuracy (which is 64%, a bit better tha nguessing)
for one, that learning rate seems pretty large, try with a way smaller one, like 0.001
first time doing anything wit htransformers 😄
tried 0.001, 0.005, 0.0001 etc. let me retry
feel free to suggest any metric to track
the whole code: https://bpa.st/LDUIK
the loss for one
also accuracy
https://bpa.st/4O4EO loss & validation accuracy
seems like increasing the data really helps a lot - curious. I tried the same with a veeeery basic bert model and there I needed waaaay less data. Now I'm at 50k
thanks
what do you guys make of this?
Hey smart people!
Hastebin is a free web-based pastebin service for storing and sharing text and code snippets with anyone. Get started now.
I'm trying to build a super simple specific-use-case image sharpener. I'm going to try to remove the frames from and then outfill pokemon cards. I want to bring them all up to a consistent resolution first though
I have about 1000 google colab credits, or about 100 hours of Colab time. But, that time is money, and so
I want to make sure I've covered my bases before I sit down and start training
Any thoughts?
could you provide more context on what you're trying to do?
Or maybe I'm out of the loop. I can see why Slack has threads to keep everything together...
this really isn't my area of expertise, but here are some thoughts/questions: I can't tell where you're making sure your input images are all the same resolution first? Instead of using Google Colab, could you train and test locally? Super dumb question, do you have a test dataset so your model knows what success looks like? Or define some success criteria somewhere?
I'm having trouble with PyArrow+Parquet: I want to store data partitioned by a field a, which seems to work. When reading, however, it seems I can choose between streaming reads or filtering on the partitioned column, not both: ds.parquet_dataset doesn't support filtering by columns not present in the files (because of partitioning), pq.ParquetDataset does, but can only be read all-at-once into a pyarrow table or pandas df. What gives?
Heres that ai powered symbolic regression system Ive been working on. Its up and running and im using it to train models on this dataset. Im using genetic programming and its utilizing polars. right now is doing the optuna parameter search.https://huggingface.co/datasets/yoshitomo-matsubara/srsd-feynman_easy
Maybe you can use "pyarrow.dataset.Scanner" https://arrow.apache.org/docs/python/generated/pyarrow.dataset.Scanner.html#pyarrow-dataset-scanner
ya check that out., maybe ds.Scanner.from_dataset I see that in there.
Hm, I'll take a look, thanks
np. good luck
Ah, but that doesn't work with a ParquetDataset
Only with normal datasets, which already support the to_batches() method
?owner
(I figured it out: If you give the normal dataset the partitioning argument, then it can successfully filter on those columns.)
!paste
If your code is too long to fit in a codeblock in Discord, you can paste your code here:
https://paste.pythondiscord.com/
After pasting your code, save it by clicking the Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.
Im trying to design the preprocess data to be as broad and flexible as possible when dealing with datasets . You guys got any ideas or suggestions?
https://paste.pythondiscord.com/JRXA
probably should have went with pandas but i wanted to use polars
datasets/models are different so there's no fit-all method
for example, you should not ordinal encode if you're using say linear regression
nulls in a ParkingLotArea feature might indicate that there's no parking lot, so you should fill with 0
etc etc
also
- if you pass
trainandtestseparately, the ordinally encoded values might not match - if you concat
trainandtestand pass the 1 df in, filling nulls withmeanis leaking data fromtest,StandardScaler()is also leaking cause it seestestdata, etc
for stuff like StandardScaler(), TruncatedSVD, etc. what you should do is .fit() (and .transform()) on train, and only .transform() on test
Not dumb questions at all!
To answer - I'm taking random 512x384 (4:3) crops from magic cards and marvel snap cards, adding some artifacts by doing an intentionally poor JPEG compression as well as a bit of noise injection, and then running that through the sharpener. I'm comparing the result against the original high-def cropping
If you find yourself looking for meaningful data to play with.... just start a data logging habit/hobby.
There are so many things i would like ML/AI to help with here, but I don't know where to start.
I'm working on a little project to enhance, remove the frames from, outfill, and then upscale pokemon cards. I want to start by sorting them all by frame type
Sadly, there are too many cards and too many types of frames to label them myself. Are there any straightforward ways of automated class discovery?
Hey, for training ML Models is it feasible to use AWS or amazon sagemaker or saturn cloud?
training models is what sagemaker is for. idk what saturn cloud is.
okayy
whats the pricing?
I don't know
ok
Nice Viz.
This looks like timeseries.
Some easy things are finding correlations, forecasting, anomaly detection, imputation, nowcasting
plot per iteration, instead of per epoch, if you are only showing 2 epoch
Nice
Maybe you could limit your picture set to cards with all the same frame type? Start simple and train the model. I found this pokemon card database website and if you click Advanced Search, Format, Standard Legal, it appears to show cards with only a certain kind of frame. For the most part
from a data analyst or business analyst perspective, you could try to answer questions like: what uses the most power in my home? how can I make my home more energy efficient?
This could be useful, but I've already downloaded all the cards.
Now that I'm properly rested (and I can see straight). Here's my project in a nutshell, and how I think I might be able to pull it off
I've downloaded 18000 pokemon cards. I want to sharpen them all to a standard resolution, remove the frames, outfill the background, and then upscale them to 1024x1024. This will be good practice with a bunch of tools, while hopefully being fairly simple
Unfortunately, the very first problem I'm coming up against (beyond sharpening, which should be fairly simple) is that there are like 30 different types of frame scattered throughout the dataset - not including variations by color
If I want to remove the frames, first I need to teach the system to recognize them. This would be simple enough if they were labeled, but they are not, sadly.
What I can do is create a bunch of pokemon cards using a card maker and use this to teach it to recognize all the frames it can. This should function fine for a large portion of the dataset, leaving only the outliers
Then, I figure I could make a bunch of cards using card makers from other games and, with a focus on generalization, try to train a system capable of one-shot classification
The only other option is a siames network trained on contrastive pairs of cards and augmentations of themselves. I think the idea here is that if it can learn to align the embeddings of a card and, say, it's flipped and slightly color shifted version of itself, the latent space starts to self organize. After seeing enough cards with very similar shapes, the orderliness of the latent space makes k-clustering a possibility
Any thoughts?
some kind of image segmentation algorithm?
Hehe - see my wall of text above to know where I'm at with all this. Not sure if any of it is viable
Yeah, I don't entirely follow all the details but I feel like you're thinking of some big complicated system instead of one step at a time
First thing is first: you want to extract the art from the image of the card, right? So just focus on doing that.
I agree this is a great project BTW. In part because it requires you to do exactly this kind of thing, pick it apart into sub projects and solve each piece one at a time.
Totally. Once I'm done I should have enough vocabulary and experience to tackle something super worthwhile - and, I'll get expanded art pokemon cards out of the deal
That said - I know I need to tackle this one step at a time. The first step, after detail enhancement, is learning to tell what's image and what isn't. If every card had the same frame then it would be simple. But there's a zillion of them - even the "base set" has undergone a bunch of modifications over the years
How about this.
Pick a card at random. For every other card, compute the MSE and select the 100 cards with lowest MSE. Have the system copy them to a working directory and manually inspect them. Remove anything not adhering to the most common card-type among them. The result should be a set of cards with the same frame. They become a cluster.
Repeat, this time omitting any cards already in a cluster.
Once every card has been clustered, repeat this process for clusters instead of individual cards.
hey guys
for ViTs, do people usually use multiple transformer blocks or nah?
i may not be on, so reply to my message so i get the ping
Anyone want to help me build this into a githib project? I feel like I got a solid foundation . I want to use GPU acceleration with rapids for polars but I was having issues with the conda install, i need to sit down and look at it again. Has anyone had success with it ?
since you keep posting screenshots with lots of text instead of actual text that would help solve the errors you're having (I have asked you before to stop doing this), I'm going to start ignoring your questions.
Alright man, seems really silly, but you're in charge.
when you ask questions in a way that make people have to interview you in order to start helping you, you're wasting everyone's time, not just mine. if you're having issues with a conda install, the first step for the person who helps you would be to google the salient part of the terminal output from trying to install it. so if you want help with that question, you should post the whole output of running that conda install as text. Not a screenshot of some logging from an experiment.
Uh, I don't fully understand what you're saying since I haven't done work this complex. I did find this Youtube video about computer vision and cropping to the Region of Interest might be useful https://www.youtube.com/watch?v=kCyD0nfMwp0
Hello Friends,
In this episode we are going to o How we can extract the Region Of Interest(ROI) from image while working on any computer Vision Machine Learning Projects using openCV library.
Crop Images using OpenCV | Crop Images| Computer Vision | Data Magic
#cropimage #opencv #computervision
Please Like, Comment, Share and Subscribe!!!
...
I do wish this Discord had threads like slack, and I think the #1035199133436354600 channel auto-closing threads after an hour isn't that great, but your big screenshot doesn't make it the easiest for us to help you
I would also try googling the error message regarding the conda install, or try stack overflow. The problem you're running into sounds like something lots of others have run into too
@clever current Discord does have channel threads like slack, in addition to forum channels (which are just bundles of threads). we don't allow non-mods to open channel threads.
Yes I know, but I see I can't start threads like you're saying
but no matter where one asks their question--this channel, the help forum, SO--the asker needs to fully expose their question
oh sorry, you said this Discord. my mistake. I thought you were talking about Discord in general.
No problem! Agreed getting all the context is important
Nice. You hit a nail on the head. Reminded me of exactly where I want ML.
The power data.
Given nothing BUT the power data for a circuit, produce a list of "likely candidates" and their aggregate power consumption.
I can provide "hints" based on actual boiler plate device values, but ultimately it's a classifcation of the deltas while absorbing noise.
"Likely candidtes" means devices. Consider "An unnamed device consuming approximately 100W cycles for 5 minutes every hour. We suspect it is the same device, so we can label it."
I suck at ML though. I have the data, the CPU, 20yr SE exp, not near to 0 ML or AI.
Honestly my suggestions don't have to require ML. They're just basic analytics questions to me. You can just find max(power_usage) or make a nice graph of energy use over seasons
Already have that. My question is. Without having a power monitor on EVERY indivudual device, what can I learn from the aggregate deltas?
You don't need to use surgery tools when scissors will do. Also I'm curious your screenshot showed Celsius, are you based in Europe or something?
Ohhh it sounds like you want to take aggregate power consumption and try to de-aggregate it into individual devices, or at least make a best guess. I haven't really done a problem like that.
Exactly.
It's a dynamic feedback classification thing.
"thing" == not experienced in lingo.
My first attempt was to "hisogram" the deltas. quantise them to 10W intervals and ... no. it didn't work.
I off loaded data into PySpark and Java Spark, but just got lost.
the later did get me a lot more power over aggregation though.
You mean, histogram. And "the latter"
Sorry I don't think I can help you much with this, I feel like I've been spending too much time in this discord 😅 and I need to be applying to analytics jobs in my area (Texas) instead.
The system receives Watt values. If the last value was 1023W and the current is 1123W, then "someting that consumed 100W switched on".
Sorted right?
Unfortunately not. Noise.
This is why I went for "Quantise"
I got back to looking only at 500W changes and ... it still failed.
Obviously I have no idea what I'm doing.
Hello every one, I hope you are fine, I'm 19, I started python 4 months ego and focused on django for about a month, I did some web applications pretty cool but I think of leavig all these to focus on AI/ML. Please I need some advice on where to start, good roadmap from beginner to senior and if I really made the right choice
Is your purpose to make salary or make engineering?
It matters because "AI" is a buzzword worth 90% of the value to companies.
They are wrong, but if you want in on the buzz and recuitment jazz.
I will say, both to the first question. I am really passionate about programming in general and also the salary attracts me
Respect.
do you have like a roadmap to guide me on this path?
My answer would be. If your salary and thus life doesn't depend on it....
Do whatever is interesting and productive.
If you are looking for a job. Different answer.
So I want to take an existing model for image recognition with camera vision, and add another class onto it. 1. whats the best way to go about that? 2. I have a dataset but how must I format each of the images for the model? I put paper towel below the subject in order to provide a contrast but idk how else I have to format it.
can you be more explicite please
AI/ML etc are poorly understood by those who recruit, the get little help from those that know.
I am only trying to ask if you are looking for a job or have a more specific topic.
Let me put this another way>
https://youtube.com/watch?v=BKorP55Aqvg
Don't end up this guy.
Subscribe for more short comedy sketches & films: http://bit.ly/laurisb Buy Expert shirts & hoodies at https://laurisb.myshopify.com/ Funny business meeting illustrating how hard it is for an engineer to fit into the corporate world! Watch the next episodes: http://bit.ly/SquareProjectEp1, http://bit.ly/SquareProjectEp2 & http://bit.ly/SquarePro...
Actually I'm just exploring what I can and settle on something sweetable for me. I chosed AI ecause I have seen the exponential growth in its popularity and also because it somehow ties with what I like in programming(Logics). But please tell me more I feel so naive
okay thanks and for the raodamp?
MSE of what though?
You might be interested in hierarchical clustering... but I feel like I'm not understanding why this isn't just an image segmentation problem
I was just wondering if anyone had any success with getting it installed.
is the yes/no answer to that question literally all the information that you wanted? if not, you should bake the follow-up question into the original question.
"has anyone had success doing x? I'm trying to do x, and this is the issue I ran into: <code> <error message>"
just so everyone knows, @thorn pendant is also asking a similar question in #career-advice
ML is a basically a branch of mathematics, and so you will need to study the mathematics behind it. Since you already know some Python programming for web dev you should be ok on that end unless you want to be the person that implements all the ML libraries, in which case you will need to learn stuff like C++, CUDA (GPU programming in general), high performance parallel programming. The minimum required math that is often listed here is calculus (including multivariate), linear algebra, and probability/statistics.
Your web dev experience may also come in handy if you want some UI for what you are making and for working with databases if you have done that.
I don't think you need to know any C++ or low level CUDA stuff unless you want to do ML eng specifically or research
Certainly not as a beginner... so much math and practical foundations to focus on
Not to mention basic data analysis skills and at least a bare minimum statistical intuition
Yes, only if you want to implement all those libraries everyone uses, it's an entire extra set of skills needed if you want to go down that path.
Right, I just wouldn't include it on a roadmap for "AI/ML" in general
Some people really enjoy that, and so I bring it up as an option since it is its own unique job.
Fair
IMO it's like putting low level networking protocols on a roadmap for web dev
Maybe useful in certain jobs but definitely not core
Yeah like how maybe you are into (backend) web dev, but really like databases so much so that you want to work on them in C/C++/Zig/etc. It's a different path that is still part of it all.
In the case of ML, you need the math either way.
I'm probably just misunderstanding. It is a segmentation problem - the problem is that I don't have the time (or the artistic skills) to segment even a small sample of every variation of every type of frame in every color
Which, in my very inexperienced opinion, means having it learn to do it on its own, and that means comparison of something against something else. That in turn means classification. Is there something I'm missing?
Can you post an example? I saw you mentioned MTG above but then I thought you said Pokemon later on
And remind me, how many distinct frame types do you think there are?
And can they be grouped at all into similar categories? Like 3 different types that are all pretty similar
Hey, I have a basic question about gradient descent. How does it find absolute minima? It seems like it would only be guaranteed to find a local minima. How do you ensure you find the global one?
Sadly, no. There are two dozen or so frame types, and they've undergone multiple minor alterations over the years. They also differ by color. In total, hundreds of different frame types
Gradient = abs(min(output))
Loss = Gradient - output
print(loss)
it doesn't finds the global minima
(unless the gradient only has a single local minima, but that's not the case for ML)
if you train the same type of model on the same data with a different seed multiple times, it is entirely possible that it will reach a different minima and get stuck on a different loss each time
Correct it is not a global minimization unless the problem is convex
That's part of why things like early stopping, gradient descent variants like "momentum", and parameter initialization can matter: you're not even necessarily trying to find a local minimum, because that might be overfitted to the training data
The actual objective function is generalization error, not loss on training set: but we have no way to compute that, so we use validation/test sets, cross-validation, resampling, etc to estimate
Yes but how minor are the minor alterations? Can you show some examples? Are there any broad categories at all? Or are there hundreds of completely different frame types?
At the end of the day I do think you need to roll up your sleeves and manually annotate a couple hundred cards, just so you have a good baseline to test your algorithm. But I doubt you even need a CNN for a first pass at this
And regardless of whether you use a CNN or something simpler / more old-fashioned, yes you are going to have to go off-piste a bit and pursue some kind of "semi-supervised" approach, whether that's actually training a model on a mix of labeled and unlabeled data, or a multi-step thing
Fortunately, that kind of problem arises all the time in industry, and I think having experience solving that problem is tremendously valuable
You can also consider the active learning approach where you use a model to help you choose fruitful examples to label, instead of randomly sampling
Well, I've already toyed around with some possibilities for automated class discovery, and gamed out potential strategies for manual labelling. Fortunately, I think I've found a halfway decent solution
But seriously, have you tried just scratching out some heuristics first? At minimum it can help you get a better idea of how a good model should work
Good. What did you find?
Here's one example - EX versus EX mega
Holy shit, those are a lot more advanced than what we had in the 90s
What would you even consider to be the frame boundary in those examples?
MTG would be much easier haha
And some examples of how the "basic" frame has changed - a few examples mind you, they change almost every expansion
Well exactly. Somehow I need to remove "everything but the art". Obviously it's a lost cost for some types of frame, but I can get most of them I'm sure
You're not actually interested in classifying frame types, right? You just want to get the art extracted so you can upscale it?
Yeah, I wouldn't even bother trying to classify these
One helpful person suggested using the official Pokemon.com card database. I was initially skeptical because I doubted the search algorithm would cooperate - but it turns out I can search by set then card type then energy type. This will work pretty well for labelling I'd say
Forget everything I said above, now my first instinct is to put together some kind of unsupervised vector embedding (autoencoder?), and then sample several dozen cards as evenly spaced as possible across the embedding space, for manual annotation
The images are much smaller, and that's both a blessing and a curse
SEE!? SEE!?
I'm NOT crazy!
How does that help?
I mean, these frames aren't even always "frames" -- forget it imo
Well - most cards are fairly simple. 80% or so I'd say have fairly straightforward layouts with a clear distinction between image and frame. I'm happy letting the other one's die off as casualties of war
Ah, okay
In which case you might still want to focus on the frame, but with the specific characteristic that indeterminate or unusually complicated cards get rejected as such
But I would still avoid trying to classify all frame types
As for why I'm doing this at all - practice. I've got a big idea for a cool somthingorother, and I need practice. This project will force me to get my bearings on upscaling, autoencoding, segmentation, and perhaps even diffusion
My initial instinct was that, and most cases, the art itself will be sharply different from the surrounding card background, so whatever you do should focus on finding that boundary
Yeah - some people mentioned canny and other simple algorithms, but I don't think that'd be quite right. And who knows! With the right architecture and maybe a pinch of meta-learning, the thing could work better than we'd think
For cards without frames, the ones "where its hard to tell where the frame begins and the image ends," that could be treated as a restoration/text-removal problem instead of a segmentation problem
Anyway - using this pokedex I can sort first by set - and cards have consistent shapes across sets - then by card type and then by color. These will result in folders with a few dozen cards each. A little manual inspection to fuse sets which didn;t change card layout and bam, labeled
That's a very good idea, use whatever information you have available instead of starting from nothing
Well
The pokemon database has some decently robust anti-bot measures
Which means I'm going to need to crawl through it XD
Hello hope everyone is well. Im working on a feature in a application and saw that i can implement an AI Model. i want to compare Result with expected result and output if test is positive or negative. i never worked on projects so that would be my first project and i have a bit of knowledge in ML(Andrew NG Course). Can someone help tell me what type of problem is this called and what algorithm/s should i try. Thank you
Can somebody tell me where we tell in this code that we need a steps of 5 on x axis and step of 20 on y axis ???
are you looking for model evaluation?
yes
i want to know if possible which lagorithms should i read about that might help me solve this
depends
if your model predicts some number like 12.3 then it's a regression task
if your model predicts from a set of possible answers, like it must be either 'apple' or 'orange', then it's a classification task
different tasks has different metrics you can score your predictions vs. real values against, which in turn will tell you how good your model is
it is a classification model with eithe rpositive or negative
it compares result with expected result and conclude if positive or negative
then it's classification (only positive or negative), and a binary classification at that (only 2 possible outcomes)
simplest to understand is accuracy, or (number of tests the model got right) / (total number of tests)
yes thank you but do you know what algorithms should i research about?
wdym by 'what algorithm'
what algorithm to do what? to do the predictions? to measure how good your model is?
do predictions
then what you're looking for are the models, not how to evaluate them
what about looking at some simpler ones first like logistic regression?
and, if you're already following a course, shouldn't it tell you what models are?
i was thinking of logostic regression but i am working with texts not numbers
then the keyword you're probably looking for is NLP, or Natural Language Processing
i will check it out
thanks
is there anything else you advice me to read about?
not really
what you said basically only tells me you're doing an NLP classification task
okay thanks
in the definition of the lines you plotted, in the above cells
there are many resources on "text classification". the technique is almost always the same: figure out a way to represent each document as a list of numbers, and put that into your logistic regression or whatever model
where is the definition of lines in this code? and what is definition of lines?
plt.title("Bank robber got caught")
plt.xlabel("Time (in minutes)")
plt.ylabel("Distance (in km)")
ax.set_xlim([0, 40])
ax.set_ylim([0, 100 ])
plt.plot(time, robber_distance, c = 'red')
plt.plot(time, sheriff_distance, c= 'brown')
plt.axvline(x=30,color='green' , linestyle = '--')
plt.axhline(y=75,color='green' , linestyle = '--')
plt.show()```
In ancient times we used techniques like tf-idf and feature hashing. Now we use a lower-dimensional representation called an "embedding" or "vector embedding", derived from another model, word2vec being a classic example
The fasttext library/tool is a great easy way to do text classification using word2vec-style embeddings
they aren't defined here plt.plot plots pairs of x and y points. they happen to be connected with a line and they happen to lie on a straight line because that's how they were defined. so it looks like a smooth line, but it's actually individual "dots" connected by line segments. is this homework?
no , i m learning it
i want gap on y axis of 10 instead of 20 , how can i do that ?
normally we define lines by their y intercept, not their x intercept. you need to do some algebra: find the y intercept such that y=0 when x=10
y = ax + b and you have some known constant a. plug in y=0 then solve for b, and then you can find b as a function of your desired x intercept
i think that is x intercept
corret
then ?
then what? then you modify how the line is constructed in the code, after you know a and b
in my code where is a and y?
Good day, please does anyone know what to do?
Where is a good place to host a big dataset of images? (Around 50Gb)
I am tying to use Google translate API in my ML project. but its paid, are there any better alternatives?
https://cloud.google.com/translate/docs/reference/rest/?apix=true
Task: Given a list of 10 numbers from 1-20, is the first token repeated once?
I want to solve it using a basic Transformer. I'm using PyTorch's transformer and I overfit it so I basically get 100% accuracy. I then look at the gradients using model.transformer.layers[0].self_attn.register_forward_hook(print_qkv_gradients)
but I get:
(Pdb) (query == key).all()
tensor(True)
(Pdb) (value == key).all()
tensor(True)
So the input gradients for query, key, value for all 10 "tokens" are the same. How can that be?
For who?
Amazon S3 might be an option
When I created my datasets of images for a project previously, I had decided I wanted to use transfer learning and resized all the images to the size expected by the model. This greatly reduced the size of the dataset and allowed me to store it locally. Your experience may vary of course, but just something to consider.
Its more that I think it might be useful for others. Its a database of pokemon cards. I can resize them appropriately
Doesn't Kaggle and HuggingFace have dataset hosting?
S3 or equivalent
upload on kaggle, if you got high speed network
Does anyone know how to web scrape a table off of kaggle? Been trying to parse out these html elements but can't figure out how to extract it properly.
Yea I'm aware that I could just download it, but I'm doing a portfolio project where I want to show I know how to web scrape from a proper dataset as such as this: https://www.kaggle.com/datasets/muhammadroshaanriaz/e-commerce-trends-a-guide-to-leveraging-dataset. Been sorting through different classes and <div> elements, but no luck having the info for my dataframe.
If anyone could help me solve my problem, I'd appreciate it!
You're trying to scrape from the CSV data table that's shown on the page?
That's going to be fairly hard, since that's dynamically loaded as you scroll through
Not a trivial project
I see, how would you recommend doing so?
Well, I wouldn't since there's APIs and other ways to retrieve the data. But, if you needed to scrape it, you'd have to spend some time inspecting the network view in dev tools and see what requests/responses are made and reproduce that.
does anyone know matlab's im2gray equivalent in python? I used pillow and I got different mean intensity values, for instance max mean intensity I got from python is 188.5 while matlab gave 189.4
same picture, same double precision
if i take mean intensities
python gives 79.7905864197531
matlab gives 79.685138421249505
ok its ready to rock if anyone is interested in trying it. you can process a dataset from hugging face using the args and switch the models around depending on your resources. you'll need an elasticsearch server up and running though.
https://paste.pythondiscord.com/YTIA
Sick
Gimme an hour or two
And I'll have over 18000 pokemon card images downloaded AND categorized by series, set, type, subtype, and energy color - with associated tags if needed
I've almost got these cards sorted - but I've got a question
Should I sort them by color? The goal is to build segmentation masks which separate the frames from the art. Would breaking them apart by color make it easier or harder for the system to find what's frame and what isn't?
Cool
probably no
chatgpt uses neural nets, and sklearn isn't focused on neural nets
it's more likely that nn focused libraries like tensorflow or pytorch are used
but because open ai's models are closed we won't know for sure
Depends on the company and your JD. So yeah, sklearn is used in industry.
Separate from your question: if you're asking is 'sklearn' worth learning? The answer is yes, imo. It's a basic building block that anyone working with data should be familiar with. (And I'm curious if anyone disagrees)
Like talking about the best example of machine learning like YouTube recommendations page
Does they use sklearn
Or sklearn is just for basic understanding
sklearn more deals with "classical learning" instead of "deep learning"
that means it mostly uses classical optimization algorithms instead of deep neural networks (though it does have some neural network capabilities)
not every problem requires deep learning
banned
Can someone suggest me free resource to learn math needed for ml
check the pins
Anything you'd recommend for modern NLP?
Parts of speech tagging, NER, Q&A, summarization, etc
no one cares about part-of-speech tagging anymore. POS tagging has only ever been a means to an end, and there are now better means to those ends that don't require it.
pretty much everything since 2022 has been about applying interactive LLMs in different ways.
Noted, thanks
Would you say the focus on LLMs is well placed, and if so do you have resources you'd recommend for developing and deploying LLM apps?
if you're just developing and deploying them, you're not actually doing NLP. that's just pure software engineering, at that point.
procuring enough GPU compute would be an issue.
I wonder if my question is... misguided.
If someone asks how to learn more about ML, people typically recommend ISLR or Hands on ML by Geron.
These cover theory and applications.
I'm looking for NLP equivalents, in that vein.
@main fox how well do you already understand concepts like neural networks, train/test, and regression
Decently well, can develop and deploy. Always more to learn of course.
What do you mean by develop
Because once you get to deployment, the AI stage is over. That's only about software development
I understand what models to use to answer specific questions, limitations of the models, assumptions, why we do train/test, avoiding data leakage
Okay, great
Were you gauging my understanding to offer a recommendation or for something else?
I have a link to a YouTube series that I'll send you when I get home
I'm at the gym, not skipping leg day.
Enjoyment is for the weak
To progress is to suffer.
Destroy your body and recover stronger 💪 Get those machine legs that cause quakes with every step
Now that I've got my dataset
What is the standard approach to having a network learn on its own how to segment features from images?
For more information about Stanford’s Artificial Intelligence professional and graduate programs, visit: https://stanford.io/ai
are you sure you're asking how to segment features, or are you trying to segment entities? and you do know the difference between the two?
Thank you
So I want to take an existing model for image recognition with camera vision, and add another class onto it. 1. whats the best way to go about that? 2. I have a dataset but how must I format each of the images for the model? I put paper towel below the subject in order to provide a contrast but idk how else I have to format it.
Does your dataset contain labeled instances of the classes that the model can already classify?
Does it have any unlabeled instances of those classes?
They are all unlabeled. However, theres only one new class.
And they are pertain to that single class.
I basically took a video of the subject, and extracted each frame to serve as training data.
if you continue training it on only the new class, but you don't have any labeled instances of the other classes, you won't have a way to determine if its performance on those classes has degraded.
so I would get ahold of instances for every class that the model needs to be able to classify.
Well, I would use a pretrained model that has labels for the other classes. I would solely be adding a new one.
I know. but training it on the new classes can degrade its performance on the old ones. (and it might not even learn the new one.)
also models do not have labels. instances do.
So I need to retrain the entire thing?
I might be messing up the terminology.
Instances are the training batches right?
No, instances are the things that the model needs to be able to classify. images, in this case. a batch is just a batch of training instances.
but a batch is not an instance. a basket of eggs is not an egg.
you don't need to retrain from scratch, necessarily. but you still need labeled instances for all the classes that the model has to know.
the instances for the old classes might only go in the test partition of the data.
but it's probably a good idea to keep instances of the old classes in the training data, to reinforce its existing knowledge.
Hm I see. The goal of this project is to detect ID cards on people. So what if, instead, I use the pretrained model to detect people, and I have a separate model that solely detects the ID cards. Would that be a more accurate solution?
that is, the model takes an image of a person who has an ID card (perhaps in their hand, perhaps displayed on their clothing), and the model indicates where the ID card is in the image?
Well wouldnt the second model just be trained on the id card itself (I put it against a white paper towel for contrast)? So then I can run the image and it will just check to see if it can see an ID card. The first model will confirm whether theres a person, and if both are there, then I get a true value.
None of that goes without saying.
Do I understand correctly what you want your model to do, or do I not?
My message was reiterating the goal...
Because its not necessary as of now the specific location of the ID card
you're not reiterating the goal, you're telling me about your implementation plan for the goal, but I'm still not certain I understand what the goal is.
The first model will confirm whether theres a person, and if both are there, then I get a true value.
That is the goal
that's not a goal. that's an implementation plan.
what purpose do you ultimately need for this model to serve?
proof of concept
proof of what concept?
checking if someone is wearing their ID
okay, so the purpose of the model is, given an image of a person wearing an ID, to output whether the person is wearing their own ID? Or if they're wearing any ID?
Wearing any ID
I think it would be too difficult to detect whether its their ID
okay, this is a concrete goal
Yes
now the first model: what is it trained to do?
by the way, this isn't a classification task.
An arbitrary yolo pretrained model to detect a wide variety of classes.
Oh its not?
at least, you're not adding an additional class to an existing classifier
I suppose "IS WEARING ID" and "IS NOT WEARING ID" is a binary classification task
but you're not going to get there by adding classes to an existing classifier
I'm not sure how you'd do this without a dataset of images, where the pixels of each ID badge in the image are indicated.
yeah I think maybe just a new model itself.
Wdym?
If I show it a ton of pictures of IDs, wouldnt it train the filters to detect patterns in the IDs themselves?
Not really. Images where the only entity in the image is the ID are going to be very different from images where the ID is one of many entities
And it would be nontrivial to bridge that gap
Wait, I've never heard of this being an issue. In every guide I've ever seen for object detection, you train the model on images of the object itself and then it can detect it with camera vision.
https://www.youtube.com/watch?v=-ZyFYniGUsw AFAIK they just trained on the object
Learn how to train a custom object detection model for Raspberry Pi to detect less common objects like versions of a logo using your own collection of data.
00:00 Introduction
00:49 The 3 steps of training a custom model
01:24 Step 1: Create a training dataset
04:01 Step 2: Train a custom model with TensorFlow Lite Model Maker
09:03 Step ...
Scikit in general is heavily used for all kinds of random small script stuff by scientists and engineers.
Its goal is kind of to be a Matlab substitute.
That's interesting, I didn't know that
I don't hear much about scikit on this channel, I suppose most people are interested in deep learning now
So scikit would have stuff like K Nearest Neighbors then? I'm very new to machine learning
Fundamental algorithms SciPy provides algorithms for optimization, integration, interpolation, eigenvalue problems, algebraic equations, differential equations, statistics and many other classes of problems. Broadly applicable The algorithms and data structures provided by SciPy are broadly applicable across domains. Foundational Extends NumPy p...
Thank you!
I asked this earlier but then I went shopping
I've collected a huge database of pokemon cards and I've sorted them by frame type
What's the standard approach to teaching an AI to segment the frames of the cards?
An autoencoder with contrastive learning?
Hello,
I am working on a tabular data set that contains various inputs ranging from time/date/time of day/day of week through meteorological inputs like temp and whether or not there was snow on the ground, to various other numerical inputs pertaining to speed of vehicles and their weight etc... what I want to do is to run various algorithms on that data and then have the output feed a probability model. I am doing this as a hobby project on RC car racing.... I am not a data scientist but I can write some code in Python...what sort of problems I may encounter with this approach?
I wanna do a very basic classification task using transformer i.e. a transformer encoder. Does anyone know of a very simple model that is pretrained?
That sounds like a pretty standard task to me. The only problems you will encounter are the usual problems with doing statistics and machine learning, which could (and do) fill a textbook
I mean you could take your data, random "AI model" and just trial and error or you could take a more machine learning route first and do a lot of analysis on your data. Like which features correlate to which etc. Here's a nice walk through (completely different data but concepts you coul still do) https://www.kaggle.com/code/ilialar/california-housing-analysis-and-preciction
Oh, I misunderstood... yeah definitely don't try a bunch of different models just to see what happens
Thanks for that!
Do you know which text book, or can you recommend one? LoL... I am looking for more indepth explanations than what I can find in youtube lectures.
how do i scrape data from semrush or other seo for ctr prediction problem ? by how i mean which specific url should I look for the data that I want ?
Hi guys
I was working with vgg16 architecture and while experimenting , I got to know we can freeze the layers of the architecture
Now my question , as we know that vgg16 is a 16 layer CNN model (13 conv and 3 dense) , when I freeze the first 6 layers , which layers will be freezed , will onty be the conv layer or both conv and pooling layer
anyone is here
Always ask your actual question. If you ask your question clearly, people will answer it when they look at the channel.
Alternatively - make a patently incorrect statement!
Nothing gets you correct information faster than steadfestedly claiming something false XD
pooling is not trainable
so the first 6 conv layers will be freezed?
I think SciPy is more of a matlab substitute, general purpose science and engineering. SKlearn is only for machine learning. If you want to do a t-test or do a Fourier transform etc. you go to SciPy, not sklearn.
Numpy + Scipy + Matplotlib is the Matlab substitute. The "scikit" ecosystem as far as I know was intended to consist of collections high quality libraries on top of that, but only scikit-learn became a household name
There's also scikit-image
Yeah, Scikit, which includes all of these things, although they renamed some things, scipy is what it's all built on, which is a wrapper for a bunch of common (mostly) numeric algorithms.
There is also the scikit build system, which sometimes shows up in stuff like robotics and other random projects that are using it for some reason.
Numpy is the defacto standard library for transferring dense numeric data/arrays between libraries and so it shows up in all of these.
Python's built in array type could be used, but Numpy just also has a bunch of other useful stuff so it's used instead.
And matplotlib for visuals.
(Although I don't really like Matplotlib, if you use it for basic things only, it's pretty much the easiest most direct way to plot things)
Hey all, I am working on a Project to solve PDEs with NNs and rn im trying out different initializations for a basic NN. However, it seems like all of PyTorchs inits are worse than just the plain default. Im using ADAM to optimize and Relu Squared as activation if that is relevent. I was just wondering if this is normal or if I may be initializing it wrong. Perhaps one might be better with a different combo of optimizer and activation?
I've got a question for y'all
What's a good way to monetize AI quickly and honestly
Sell the shovels
You find a demand, and fulfill it.
what did you expect?
if it was that simple, we would just do it ourselves instead of giving away the idea for free in here lol
I guess that you can try building a RAG system using internal documents
So i have this very messy graph
without drawing the lines between each point we get this
So my question is how do i just plot the outline so therefore it looks like just a bimodial distribtion?
like this!
There's nothing wrong with polling for ideas from peers 😛
Besides - a lot of people have tangential knowledge they'd rather not apply themselves for whatever reason, but might be germane to the question
There are half a dozen of repoes just like this one:
https://github.com/Marker-Inc-Korea/AutoRAG
Who wants to help me write a NN that can beat anyone in Magick the Gathering?
Nobody?
many organizations that could benefit from it don't have the know-how to set it up
This is a very, very substantial task
You'll need a rules engine - that's a tall order in itself, even if you disregard the graphics
Then you'll need some way to teach it about a deck's strategy - mill vs self mill vs token spam vs voltron, etc
Those strategies will need to degrade into medium and short term goals, and then it'll need to relate card effects to those gaosl
AND it'll have to balance pursueing it's own goals against sabotaging the opponent's board state - except in cases where it can instead take advantage of the opponent's board state
You don't need one AI, you need many
now this is epic (red is true bounding box and green is prediected)
Ice Bear
BTW, are you building an auto targetter? Cool
now i learn pipeling in sklearn
which algorithm you are using
@faint quail would you share the code
Twas a good day sorting pokemon cards
It turns out ml takes time for even the best hardware. Doing hyperparameter optimization and after 2 hours only 60 trials done. Maybe the 5090 coming out soon could be worth, but idk maybe dual 3090's would be better
in fairness, the 4090 is not the "best hardware" if you're doing AI
you'd wanna be able to parallelize the hyperparam tuning over several tasks running either on a gpu with a huge amount of vmem like an A100 or better, or over several gpus like a 4090 or better (ideally several A100's)
Hello, I have photographs which are collected from users where they are expected to capture it using mobile camera, but some of them them upload photo from print or other display device eg. taking photo from computer scrin.
How can we approach such issue, please guide
Ok so vmem is the spec to go for, not vram? Because yeah as you can see Im not even using all of my memory
i meant vram, my bad
24 gigs is better than other consumer graphics cards, but not a huge amount either
the a100 series from a few years ago has 80 gigs of vram, and there should be newer models out
i guess the h100 series uses the more recent architecture, but still has 80 gigs of vram. you usually find pools of several a100s or h100s in a compute cluster, like what squiggle showed
iirc the one at my uni has 12 a100s in the compute cluster
yeah there seem to be 2 of these bad bois https://www.gigabyte.com/Enterprise/GPU-Server/G492-ZD0-rev-100
They let you use it if you ask?
at least here, you fill out a form and get a signature from a professor to verify you actually need to use it
then you're given an account and can submit jobs as you like using a scheduler like slurm
An interesting perspective is that the fastest super computer in the year 2000 cost $110 million (and was very large), and the Nvidia 3090 cost about $1500, but can do 3x more operations per second.
It seems like I'm not maxing my vram the same way I do when I run an llm though, so I wonder if I just need more tflops or something
It's best to run a profiler to check.
(Nsight is part of the CUDA toolkit)
Though I think moore's law died due to quantum tunneling so now our components just increase in size and heat instead
The next phase will most likely require different architectures and maybe a different medium (than silicon). And different algorithms more suited for those architectures (probably not backpropagation).
We will also have an in-between state, where you see stuff more like NPU that is being shoved into things. Where there are components with special purposes / architectures that the CPU cores direct to do whatever (like how the cores on a FPGA just orchestrate things).
The types of algorithms being used in practice are heavily driven by the available hardware design, and that is a feedback loop since they design for the popular software trends.
(Stuck in local minimum)
That's actually very cool
hey guys, anyone knows how to access gated hf models using tokens using inference APIs ?
i misread that as wanting to automatically generate tokens and requests maliciously, oops
Is someone looking for a project on AI in healthcare? If yes, please DM me.
oops!
gracias
hi, I already have the access to the model, but the error comes like this:
already tried making multiple accs and diff access tokens
So I run some PyTorch code that at some point dispatches aten.tanh_backward.default. Now I'm wondering what exactly that implements. Does someone know how I can figure it out? Do I just go an read the source? Does anyone know what the .default means?
Also is there something like a convention that _backward might be the derivative for the autodiff engine or something?
Machine Learning A-Z: AI, Python & R + ChatGPT Prize [2024] hows this course
you don't need to learn R.
I'm immediately suspicious of any intro machine learning course that mentions ChatGPT.
i mean should it worth it
if you have to pay for it, no.
I agree with Stelercus, the course name containing ChatGPT does not give me confidence about its quality
Is anyone here very familiar with autograd?
i.e. implementation level familiarity?
How does torch.autograd perform df(x)/dx for extremely simple functions, like f(x) = e^x? Or f(x) = ln(x), which cannot be easily computed without using finite differential techniques?
Or is it acceptable to use such techniques with these very basic functions?
the derivatives of basic functions are stored/hardcoded
by basic functions, where is the line drawn?
you'd have to check the source code for pytorch's autograd to know exactly
Also, for univariate functions like I mentioned, how exactly are they stored on the DAG?
i.e. to exemplify?
if you have something like this expression: a + b in the DAG, the gradient stored is 1
For a/b, the gradient is 1/b
and for a * b the gradient is b
All these are wrt to a
with respect to a, sure
For univariate functions, how is it done?
exactly as you did now
for something like ln(a), how would I compute the grad?
you store ahead of time that the derivative of the ln is dx/x
same as you did just now with addition and multiplication. for "simple" operations, you hardcode the derivative
yeah, I understand
you trace the graph in the opposite direction and check the derivative of each node as you go along
But for illustration purposes, can you show me how it would be done wrt to a?
the classical derivative is 1/x, how would I express this wrt a?
i.e. would the grad of ln(a) be 1/a, for example?
yes
or would for sin(a) be cos(a)
just let x = a. the letter makes no difference
Ah thank you so much
I really appreciate this
any good books or tutorials in how to use matplotlib and seaborn?
i had a cool idea for a model i wanted to build. I call it Tabtransformer, pretty lame, I know. But it combines tabular data and texxt data . I'm using bert to handle the text transformer block for categorical features in the tabular data. training is off to a good start Starting self-supervised pre-training with BYOL... Pretraining Epoch 2/10: 9%|███████████▋ | 340/3750 [01:15<12:24, 4.58batch/s, loss=4.52e-6]
Its trained using the yolov2 architecture and algorithm, but the optimizer is adam, all the code is written from scratch, using cupy and occasionally tensorflow. You probably wouldn't want the code since it'd be faster just to use PyTorch and train it like that
Matplotlib has a lot of good docs and tutorials now on its official docs site
Enough until you can make more or less anything you want via composition with them.
no i want that code if you wont mind
it's a neural network so there's not much code to actually share besides the code for training it, which again I made from scratch using my own custom library and it'd be faster to just train your own model using yolov5 or yolov8 using pytorch
brother what behemoth of a model are you training
it's my own custom library but yes I use some tensorflow functions for the convolutional operations
heres an XoR solver using it (not including other files)
gang
I am using numpy, and why can't it broadcast together (500,1) with (1,5000)???
I am simply adding the two vectors together
broadcasting rules should cover (a,1) + (1,b), so WTF is happening?
looks like you have 500 and not 500,1
Traceback (most recent call last):
File "D:\Projects\sync\get-dissed\get-dissed-prototyping\pixtral_test.py", line 17, in <module>
llm = LLM(model = model_name, tokenizer_mode="mistral", trust_remote_code=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Projects\sync\get-dissed\get-dissed-prototyping\.venv\Lib\site-packages\vllm\entrypoints\llm.py", line 214, in __init__
self.llm_engine = LLMEngine.from_engine_args(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Projects\sync\get-dissed\get-dissed-prototyping\.venv\Lib\site-packages\vllm\engine\llm_engine.py", line 564, in from_engine_args
engine = cls(
^^^^
File "D:\Projects\sync\get-dissed\get-dissed-prototyping\.venv\Lib\site-packages\vllm\engine\llm_engine.py", line 325, in __init__
self.model_executor = executor_class(
^^^^^^^^^^^^^^^
File "D:\Projects\sync\get-dissed\get-dissed-prototyping\.venv\Lib\site-packages\vllm\executor\executor_base.py", line 47, in __init__
self._init_executor()
File "D:\Projects\sync\get-dissed\get-dissed-prototyping\.venv\Lib\site-packages\vllm\executor\gpu_executor.py", line 38, in _init_executor
self.driver_worker = self._create_worker()
^^^^^^^^^^^^^^^^^^^^^
File "D:\Projects\sync\get-dissed\get-dissed-prototyping\.venv\Lib\site-packages\vllm\executor\gpu_executor.py", line 105, in _create_worker
return create_worker(**self._get_create_worker_kwargs(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Projects\sync\get-dissed\get-dissed-prototyping\.venv\Lib\site-packages\vllm\executor\gpu_executor.py", line 24, in create_worker
wrapper.init_worker(**kwargs)
File "D:\Projects\sync\get-dissed\get-dissed-prototyping\.venv\Lib\site-packages\vllm\worker\worker_base.py", line 449, in init_worker
self.worker = worker_class(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Projects\sync\get-dissed\get-dissed-prototyping\.venv\Lib\site-packages\vllm\worker\worker.py", line 99, in __init__
self.model_runner: GPUModelRunnerBase = ModelRunnerClass(
^^^^^^^^^^^^^^^^^
File "D:\Projects\sync\get-dissed\get-dissed-prototyping\.venv\Lib\site-packages\vllm\worker\model_runner.py", line 977, in __init__
self.attn_backend = get_attn_backend(
^^^^^^^^^^^^^^^^^
File "D:\Projects\sync\get-dissed\get-dissed-prototyping\.venv\Lib\site-packages\vllm\attention\selector.py", line 117, in get_attn_backend
from vllm.attention.backends.xformers import ( # noqa: F401
File "D:\Projects\sync\get-dissed\get-dissed-prototyping\.venv\Lib\site-packages\vllm\attention\backends\xformers.py", line 6, in <module>
from xformers import ops as xops
ModuleNotFoundError: No module named 'xformers'
anyone know why this is happening? getting this error when trying to initialize vllm.LLM. i just ran pip install vllm mistral_common in my venv like normal.
and to confirm, i've ran nvidia-smi in my terminal and can confirm i have CUDA 12.5
ping me if you respond pls, thanks
Is this mistral_common you've installed a new or old version?
It's not a CUDA problem, these missing module problems are more likely to be a version issue, your version might be too old or too new @finite thicket
theyre freshly installed
just created a new venv and ran pip install vllm mistral_common
Is anyone here using Kedro by any chance?
I'd be really interested in your experiences with it and whether you'd recommend it
That's the most Reddit thread title imaginable
Data is 2774 rows by 70 rows, trying the TFT model from darts
This talks about command line arguments, doesn’t apply to my python program
I have a question has anyone tried making a neural network that acts similarly to them mannerisms like talking if people have already made a neural network that could talk or ones that have a habit of trying to make sure that everything's 100% perfect etc my apologies
Have you used GPT?
Yeah I have I'm curious because if you give up data on you like a video file will it pick up your specific characteristics like how you speak your mannerisms do you do something when you hear specific sound would it pick up on that in the video recording and if it were to generate and video have its own it probably would have the same reaction similar to the person
Yes
GPT incorporates many mannerisms, as you'll see from its responses, in an attempt to make it seem more "human".
The reason why I'm interested is because well they can learn from a lot but if you give it a video on just one person like audio diaries could it learn to act like that person and if it learns some more data would it become more like the person or when it have its own personality similar to the person but not quite
I know but that's programmed in I want to know if anyone who's made something similar to chat gbt too and came at a video on a specific person didn't pick up any it's the person's mannerisms how they talk etc
but why
45 of the rows are positive, negative, and neutral binary values for news articles written about 15 different companies
If I wanted to do embeddings instead, which seems like it'll be better, I'd probably need a lot more columns
are u like analyzing news articles for predicting stocks?
Yup
Never done this before though so results are terrible. So I'm considering embeddings
Has anyone worked with PyTorch?
It's just I am not sure I am using the autograd method properly
Alright I made another version of the vqvae . It should be able to handle visual, text and tabular so Im gonna start training it on this dataset I found for Pokémon. https://github.com/HybridShivam/Pokemon?tab=readme-ov-file
Hello, many of us have used pytorch. Try being more specific.
I am trying to use the torch optimizers instead of specifying the gradients
However, I am not sure if I am doing it correct
I can try showing how I did it
If I am allowed to show it on this chat
you can show code in any chat on this server.
!code
So, normally I have code with regular gradients on python of such:
a = 0.4
# Gradient
def sf(x, y):
return (a**2)*2*x + a*y, 2*y + a*x
eta = 0.5
# Number of steps
n_iter = 4
r = 1. # we will plot the function over x, y in [-r, r]
# Define starting point in the upper right corner of plot
xi = 0.7*r
yi = 0.4*r
p_x = [xi]
p_y = [yi]
for _ in range(n_iter):
dx, dy = df(xi, yi) # computing the gradient
xi -= eta * dx
yi -= eta * dy
p_x.append(xi)
p_y.append(yi)
And the way I wrote using torch:
xi = 0.9 * r
yi = 0.8 * r
x = torch.tensor(xi, requires_grad=True)
y = torch.tensor(yi, requires_grad=True)
p_x = [x.item()]
p_y = [y.item()]
for i in range(n_iter):
z = f(x, y)
z.backward()
with torch.no_grad():
x -= eta * x.grad
y -= eta * y.grad
p_x.append(x.item())
p_y.append(y.item())
# Zero the gradients for the next iteration
x.grad.zero_()
y.grad.zero_()
Is this a fair approach?
you usually pick the optimizer you want to use and just step that optimizer.
which means?
the optimizer is an object that adjusts the weights of a model according to a certain procedure and in terms of a certain loss
is it in relation to:
for i in range(n_iter):
# Compute the function value
z = f(x, y)
z.backward()
# Updating x and y using the gradients
with torch.no_grad():
x -= eta * x.grad
y -= eta * y.grad
p_x.append(x.item())
p_y.append(y.item())
# Zero the gradients for the next iteration
x.grad.zero_()
y.grad.zero_()
instead of optimizing this way manually
I should use torch.optim ??
Is a histogram optional?
There isn't some universal context in which histograms are used, so you'll need to be more specific
Is this ok?
Data distribution
😂 Im using the csv file from kaggle for the text and tabular data and images nicely correspond to it.
I wanted todo it for MTG but the mtgdata I found wouldnt download
If I was trying to use a girl Network make one do I truly need to have any type of histogram?
I wanna game something out with y'all
I want to build a neural style transfer tool - and in the long run, a pose and character transfer tool also
I want to try building a multi-encoder VAE and train one encoder to recognize style using a contrastive approach - feed in pairs of images by the same artist or from the same cartoon, have the system compare latents
The problem is that if one encoder is recognizing style, the other encoder would need to be capturing content and only content. Somehow I need to enforce disentanglement of the two systems. CGTP, my main sounding board and trust rubber ducky, says the only true way to enforce disentanglement is to give each a loss function designed to make it capture what I want it to capture
But I want the "content" encoder to pick up on everything the style encoder doesn't pick up on
Is there any kind of loss term you can think of to say "hey, your encoding is capturing information already captured by this other guy?"
I am pursuing bachelors in Mathematics and computing can i make future in AI development with this domain?
In theory, you can pursue a future in AI dev without any education at all
Homebrew, baby
That said, you'll need two to four terms of calculus, one term a minimum of linear algebra, and some statistics
As well as a strong foundation in computing principles
Btw, does anyone know how normalization works on data? Because I was curious whether it would affect the classification performance on regression models such as Logistic Regression?
Or is that dependent on its penalty?
"normalization" can mean different things and the kind of normalization you should do depends on the data and the model
My branch have advance mathematics and basic computing
like 60% maths 40% cs
people without degrees almost never succeed in getting AI-related jobs.
I'm sure you're right - but for the sake of diligence, might I ask in what way you're qualified to make that statement?
Just need to be clear you're not just armchair pontificating
Input normalization: Centering alone will not solve the problem. So, a solution is to ensure that all input variables have the same scale. One measure of scale is the standard deviation. Input normalization transforms the inputs so that each input variable has unit standard deviation
I work in AI professionally in the US. I do not know anyone who has a job in AI who does not have at least a bachelors. Most of my coworkers have at least a masters, and many have PhDs.
My department also insta-turbo-rejects any applicant who does not have at least a bachelors.
That’s the kind of normalization I’m talking about
so can you tell is bachelors in mathematics and computing will support me someway?
if you take AI-related courses as part of that degree, that would be ideal. you'd have a much easier time if you got an AI-focused masters after completing that first degree.
Hehe, so, super qualified
Well lemme ask you then, because I'd like to get into the AI biz myself
yeah i am also starting learning AI sideway making projects and i am also planning to do masters in AI after bachelors as i could do that after mathematics and computing domain
I'm most of the way through my comp sci bachelor - I've got the calc and linear algebra out of the way, and my coding skills are...
Let's just say "enough," at least compared to my classmates
What else do I need?
The problem was that i was not able to get AI DS bachelors as my rank was 30k out of 1.5 million students and for AI DS i needed 15k rank🥲
it will be easier for me to answer your questions if you ask the whole question in one message.
if you want to get an AI job with only a bachelors, you need to max out all the AI-related experience you can get from that degree. take every AI course that undergrads can take, get involved in a lab. things like that. if you can't do all of that, you should expect to need to get a masters.
Well, I want a masters any way
I'll ask a more thorough question later - I gotta head off to that place
By which I mean school
Stay in school, don't do drugs, and hail satan.
can you accept my friend request in case i lose you
Be gay, do crimes
I'm here all the time.
Fine
No. Being gay is good. doing crimes is not.
if I already max out all the degree I can get, what's next?
if you've done all the ML-related stuff that you can do during a bachelors degree, and you're done with that degree or almost done, you should start applying to jobs
So I guess, it is just straight back to the numbers game, but hopefully, with better odds this time?
if you're applying and it's not going well, you might need to apply to grad schools
I already maxed out all the degrees, including grad schools
so you have a masters degree? in what?
my master was in teaching, but my PhD is in CS
how much AI-related stuff did you do during your phd?
I think I'm talking about industry jobs in particular, not academia
100%
okay, so you should have options. if you feel like your job hunt isn't going well, go to #career-advice and show your anonymized resume and describe your job hunting strategy.
My friend's company is hiring at the moment. Your profile looks like a good match. You can give it a shot, who knows something positive might come out of it.
oh cool!
could you send over your thesis?
I am curious
Does anyone understand now I'm trying to ask about needing to visualize the data using a graph or could I just not use a graph
The website that I'm using for machine learning for you ask and they are using something like this to work on the model to show data being normal and showing the data random or in between two numbers sorry
https://www.w3schools.com/python/python_ml_data_distribution.asp
What is your question?
Do I need to use a graph in general for a network to work?
Just polling again in case anyone has any bright ideas. Is there a way to force one neural network (encoder) to only capture features not captured by a second encoder in a generalizable way? The only method I know of is mutual information loss, with is massively expensive (computationally)
I'm not sure I understand what you mean. Your first question was about "visualizing the data using a graph" but you're asking about "for a network to work". What do you mean by "for a network to work" and what does that have to do with visualizing the data?
Do I have to have that line of code added in to network for it to work I know it's a stupid question I'm just curious my apologies
Anyone here ever use Mutual Information loss?
I've used it a few times
I’m having a lot of trouble. I want to use lightgbm to predict the name of a Pokémon given other features but lightgbm can’t predict categorical variables. But I also don’t want to ordinally encode the names of the Pokémon because there shouldn’t be an ordinal relationship between the Pokémon. What should I do??
Who says it can't?
https://lightgbm.readthedocs.io/en/latest/pythonapi/lightgbm.LGBMClassifier.html pretty sure all you have to do is encode your classes. If you have categorical features, you might need to specify the columns
Does this also work for the prediction feature being categorical?
When I tried to put in my prediction column as y it said it can’t read strings but then when I tried to put in my y as one hot encoded columns it said it couldn’t take the dimension
I tried googling the issue but I got nothing so I know I’m definitely just missing some key element
Yeah that’s why it’s a classifier. All you need to do is label encode the classes. You can experiment and see.
Is there a better way to encode other than ordinal if the values have no ordered relation ?
Wait really??
afaik
They have a special class for the classifier so yeah it shouldn’t treat it as ordinal. I don’t see why they would code it that way.
But like if I labeled charizard as 1, venasaur as 2, and pikafhu as 3, wouldn’t pikachu be closer to venasaur than it is to charizard ?
Oh shoot
Even though it just labels it 0, 1, … n (number of classes) it won’t make an ordered relationship where 2 is closer to 1 than it is to zero?
Yeah that’d be an easy way. But if it was me i would use the pokemon’s pokedex number
would that solve my issue of the labels having a false relationship ?
Sorry I’m just really tripping out about that one small thing
Try it. The classifier class should be aware that it’s not ordinal.
It can do that??
if you’re using regressor then maybe it’s a concern
Try it and evaluate your model
If you look at their code examples they all use 0 to n-1 for classifier
Okay thank you I didn’t know these models could decipher that the relationship isn’t ordinal
That’s actually really helpful tysm I’m also prob gonna use pokedex number that was good idea
I found the images also correspond the the numbers in the dataset , which is nice.
I’m sorry I don’t understand
This dataset I found aligns with the images in the order of the numbers. https://www.kaggle.com/datasets/jaidalmotra/pokemon-dataset?select=Pokemon.csv
The "classifier" model ignores order, the numbers are arbitrary
But the "regressor" model will interpret numbers as numbers with an ordinal relationship
O Im not using that dataset i downloaded my data from Pokémon showdown API
Omg dude that actually makes so much more sense 🤦♀️🤦♀️
Is this also the case for the features?
Do I have to one hot encoded the features as well? I assume so right
Like the input features
No, completely unrelated. Classification is about the label only
lightgbm specifically has a way to state which features are categorical via its Dataset API, I don't know if it's doable through the sklearn interface
You don’t have to one hot encode it but you have to specify the features that are categorical https://lightgbm.readthedocs.io/en/latest/Advanced-Topics.html#categorical-feature-support
One hot encoding in a tree based model can be questionable
Oh dang so it automatically encodes it for me
Ya that’s sick tysm
Tree based model?
Sorry I’m new to all this
Yes, you should read how lightgbm works
If you’re using logistic regression then yeah you should probably one hot encode but lightgbm is a more complex model that can learn more complex shapes so it’s better in that regard
Sort of. You can't put in strings from what I remember -- they need to be numbers, but you tell lightgbm that the numbers represent categories
Okay I will read about gradient boosting cuz I think lightgbm is just a more optimized version
Okay thank you very much
All magic card images
# uid : a randomly generated 12-digit hex string
# src : the actual location of the image on the internet
# via : the webpage on the website which hosts the image
# hid : the card's name
# utf : the datetime the image was downloaded
# bid : the id of the 'batch' of images downloaded in a burst
# license : Rights Reserved WotC
# attribution : the artist's name
# category : N/A
# subcategory : N/A
# filename : '{uid}.png'
# description : N/A
# tags : N/A
cursor.execute('DROP TABLE IF EXISTS Images')
cursor.execute('''CREATE TABLE IF NOT EXISTS Images (
uid TEXT PRIMARY KEY,
src TEXT NOT NULL,
via TEXT NOT NULL,
hid TEXT NOT NULL,
bid TEXT NOT NULL,
utf TEXT NOT NULL,
license TEXT NOT NULL,
attribution TEXT NOT NULL,
category TEXT NOT NULL,
subcategory TEXT NOT NULL,
filename TEXT NOT NULL,
description TEXT NOT NULL,
tags TEXT NOT NULL
)
''')
what would you do instead?
May I ask a question I'm specific ways in a way could work like a 2d array for images of 3D array for three dimensional objects etc is there a paper that goes into detail?
Integers & use the lightgbm option to declare which features are categorical
Yeah, agreed. Catboost has the same option
If you forget setting them as categorical with lightgbm or catboost it becomes ugly though
Tricky look at this dataset. It's 5 gigs of magic cards in the h5 format. This structure fits right into my model. https://osf.io/kq9js/
Cool! How many cards?
Is it just card art, or fan art also?
I wanted to learn machine learning, could someone please guide me towards some best resources to learn ML from?
okay logical question now
I am trying to train VAE
but I have 5 input images for corresponding output image
didn't get that? my bad
2 directories -> sketch and photo
sketch contains images which will get trained model and
photo is like labelled images from which loss will get calculated
but for one photo image I have 5 sketch images
so can I train 5 train images for 1 photo images on VAE?
May I ask her thought experiment
What's the possibility of a neural network quote unquote ingesting a virus and then the virus gets transcribed and then the neural network becomes viral in nature
0
I'm sorry
But how can you be sure I'm at work only knows what date is coming in you can't differentiate certain types of data groups what if it infects an image and then parts of the code or it was generated to go into images and change specific parts which gives the neural network instructions as it's going through training data it imparts some of the qualities of both the virus and the network itself becoming an adoptable virus
when you learn more about neural networks, you will understand that a neural network in itself cannot turn into executable, self-replicating code.
You never know it's just meant mathematics and the same formulation Annette goes awry I can be reproduced to go right again if it seems the right mathematical formula puts it into a viral like cell it's own computer virus to to find a way of infecting other neural networks in essence around Network becomes viral itself and watching neural networks is more of natural science you can never be 100% confident in what they can really learn
Why not just do it 5 times?
nah, it will be too hectic
If you have an optimizer and 3 Nerons that have the learned pattern it could reprogram via a built in optimizer
Neural networks don’t execute code at least not on their own. To them it’s just data they will use to optimise to whatever the targets are. NNs aren’t some machine that suddenly knows how to execute x86 on the host machine just because it ingested bad data
Now if the Deep Learning framework you’re using has some CVEs then that’s a different issue
What I mean is the virus somehow gets onto your terminal finds any active material and checks to see if it might be a neural network and if it isn't go on to the next file then the next file and then the next file until it finds a neural network and it would be a library consisting of its own data and maybe two you're on the race based off of that data which would be 'injected' into three neurons changing the neurons to learn oh that data that we thought was bad okay it's good even if it's a deep learning Network it can change many different things depending time what process it's going through
Do you know what neurons contain? Just numbers. At worst you’d have a model that’s bad at predicting
It’d be doing matrix multiplication on wrong numbers
Still enough bad inputs can turn into severely worse consequences for such a network
It really doesn’t work like that. That’d be saying there’s a certain combination of a matrix multiplication that’d somehow mess up your computer. Or even
float64 * float64
that’d mess up your device
Would it be possible for a virus to recognize it's is about to learn and replace the data files my apologies
Lemme run something past y'all
I need to make a diffusion model to outfill pokemon card art - to expand the art. To do this, I need 512x512 images (target size) which mimic the art style I'm after. But the only images in the right art style are the cards themselves - and the art from those cards is too small.
Could I train a diffusion model on 256x256 images taken from the cards and then use tiled diffusion to create high resolution, non-artificially upscaled 512x512 images?
And then train the outfilling model on those?
I got the MTG data loaded but the training times, sheeesh Training Epoch 1/20: 1%|▏ | 12/1539 [09:50<22:27:24, 52.94s/it, Loss=2.1, PSNR=9.69, SSIM=0.142]
I was meaning to ask - how many cards are in that dataset you showed me?
Its a good question. I haven't been able to figure that out. It says default cards, so I need to see maybe what that entails.
im using both right, i wanted to experiment see how they can relate both types .
relate pictures to card text/types?
Just thinking out loud, but I feel like your best bet would be to scrape wither https://scryfall.com/ or https://gatherer.wizards.com/Pages/Default.aspx for the actual cards and then just crop images from any cards whose frames make it easy. With multi-processing and and asynchronous requests you could probably download the entire database in a few hours
A fast, powerful, comprehensive Magic: The Gathering card search.
Gatherer is the Magic Card Database. Search for the perfect addition to your deck. Browse through cards from Magic's entire history. See cards from the most recent sets and discover what players just like you are saying about them.
And have the cropping done in about as much time
Good idea, ill check it out. let ya know
What is the best use to make a 5 dimensional array for possible looking at a different timeline
Wdym? How to make a 5 dimensional array?
What I mean is making up five dimensional space for a neural network to understand concepts that the human brain can't through deep learning and simulations
So you're trying to understand how to create a nn?
Yes
Maybe start with. https://iamtrask.github.io/2015/07/12/basic-python-network/
A machine learning craftsmanship blog.
Thank you
You guys see Nvidia new open source multimodal? https://huggingface.co/nvidia/NVLM-D-72B
I found a quantized version but you still need 48 gigs of VRAM.
Hey smart people!
Here's my plan: I need a diffusion model capable of outfilling the card art from pokemon cards - I want to expand them from approximately 500x300 to 512x512. To make this model I need art in an appropriate style that's 512x512 or so, right? The only art I have, though, is the card art itself.
Two options - the first being just upscaling extracts the from the card art
The second, much more complicated but much more fun, if to train a smaller diffusion model on 256x256 random crops from the card art and used tiled diffusion to create 512x512 images in similar styles.
Both options will inevitably introduct artifacts into the dataset. One is simple, one is complex but also a "diffusion model with training wheels" and thus good practice
Thoughts?
where to learn statics for data science
Helu can anyone provide the resource for nlp?
I scarped the content again and the size is a little over 8 gigs, its 3 gigs bigger than the other dataset i found I also cropped the images. Want me to put it on my google drive?
I appreciate the offer, but when I need to I'll just scrape scryfall myself
That way I can be sure
generate_converted_dataset(
out_img_type='border_crop',
out_bulk_type='default_cards',
save_root='./data/converted/',
out_obs_size=(224, 160),
convert_speed_test=True,
)```
That made it really easy.