#data-science-and-ml

1 messages · Page 147 of 1

pearl blaze
#

Let me join it

#

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?

proven pier
#

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

upbeat prism
#

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. 🙂

serene scaffold
upbeat prism
#
(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?

spare forum
#

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

proven pier
final cobalt
#

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?

upbeat prism
upbeat prism
jaunty helm
lapis sequoia
#

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

brave sand
#

what is the minimum number of layers a CNN can have?

unkempt apex
brave sand
unkempt apex
#

then where is hidden layer?

#

how will your NN will learn about data then?

brave sand
unkempt apex
#

you can say that!

brave sand
#

well is it the same for a CNN?

unkempt apex
#

so a CNN is just -> convolutional layer + NN

unkempt apex
#

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

brave sand
unkempt apex
#

so you can add more than 1 conv layers

brave sand
unkempt apex
#

read this

unkempt apex
final cobalt
#

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?

severe shore
#

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

rich moth
#

its starting to look better, but now everything is in black and white. Ill see how more training goes.

rich moth
rich moth
# brave sand but the minimum is 3 right

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```
pallid badge
#

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.

left tartan
pallid badge
#

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.

left tartan
#

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

pallid badge
#

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.

left tartan
pallid badge
#

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

final cobalt
#
    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

desert oar
#

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?

final cobalt
#

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

desert oar
#

I just recently fixed a bug caused by numerical instability leading to NaN that occurred ~20 lines of code above the actual error site

final cobalt
#

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?

scenic parcel
#

Does a 4090 make training ml models faster

agile cobalt
# scenic parcel 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

agile cobalt
# scenic parcel Does a 4090 make training ml models faster

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

scenic parcel
agile cobalt
#

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

finite thicket
#

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

rich moth
finite thicket
#

sorry i'm new to all this stuff

rich moth
#

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.

rich moth
#

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

Haystack Documentation

Retrievers go through all the documents in a Document Store and select the ones that match the user query.

finite thicket
#

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

rich moth
#

The compression rationm is 588x the input data lol

rich moth
finite thicket
#

Will do. It’s almost 1am rn but I’ll check it out tomorrow, ty 🙏

upbeat prism
#

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?

wooden sail
#

what do you want to rewrite these for?

upbeat prism
# wooden sail what do you want to rewrite these for?
#

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.

wooden sail
#

a first, unrelated, observation is that this doesn't seem to be published anywhere with peer review, so proceed with caution

upbeat prism
wooden sail
#

but yeah this basically requires you to write your own differentiation engine or fish out the intermediate results from the standard ones

wooden sail
#

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

wooden sail
upbeat prism
#

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

wooden sail
#

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

upbeat prism
#

Yeah, still trying to figure out everything because there are so many moving parts. But I have a pretty good idea now I think.

wooden sail
#

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)

upbeat prism
#

yes

wooden sail
#

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

upbeat prism
#

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.

gilded belfry
#

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:

final cobalt
#

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?

oblique isle
#

who have worked here on CTGAN ?

shrewd geyser
#

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!

serene scaffold
novel mango
#
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

lapis sequoia
#

which is 1 convolutional layer

#

for example it can learn to apply some filter

rich moth
#

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.

unkempt apex
rich moth
# final cobalt What are you making?

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 🙂

tidal bough
rich moth
# unkempt apex and what's the usecase?

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.

finite thicket
#

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

final cobalt
#

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.

random nest
rich moth
# final cobalt The only thing I'm a bit fuzzy on is normalizing contrastive loss - this measure...

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 ```
rich moth
rich moth
rich moth
final cobalt
#

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!

finite thicket
#

i did, but i don't really know what to use to generate embeddings and store them in a vector db

rich moth
# final cobalt EMA?

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.

rich moth
# final cobalt EMA?

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.

finite thicket
rich moth
#

nevermind i see it up above, im gonna read it agian

rich moth
#

infact, see if you can get the sentence-transformer clip model to work and tell tell me how you did it, lol

finite thicket
#

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

rich moth
#

I mean theres ways to get around it, but it would be easier to make

finite thicket
#

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

scenic parcel
#

I should do a kaggle comp

zenith lark
#

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

finite thicket
#

how do i actually use this model

finite thicket
#

also what’s a sentence transformer

gilded belfry
#

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

tidal bough
#

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?)

gilded belfry
#

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.

steep cypress
#

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?

upbeat prism
#

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.

tidal bough
desert oar
urban helm
#

Okay thats actually impressive as hell.

rich moth
#

I let it run last night till this morning

#

that tensorflow playground is pretty wicked.

pearl blaze
#

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?

final cobalt
#

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?

wooden sail
rich moth
#

!paste

arctic wedgeBOT
#
Pasting large amounts of code

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.

pearl blaze
wooden sail
#

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

pearl blaze
#

That's just a example

rich moth
rich moth
pearl blaze
#

There can be 87 trillion formulas jn arithmetic progression

rich moth
pearl blaze
#

So what's this

#

I mean what this program capable of

cedar tusk
#

seems to me as a bruteforcing mechanism

#

u want to use ai to have a filterset for less iteration requirement?

craggy agate
#

I have got the YOLOV8 Nano model in the onnx format, how can I convert it to Tf lite?

upbeat prism
#

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.

spring field
#

can you share your metrics plots?

upbeat prism
spring field
#

for one, that learning rate seems pretty large, try with a way smaller one, like 0.001

upbeat prism
#

first time doing anything wit htransformers 😄

upbeat prism
#

feel free to suggest any metric to track

spring field
#

the loss for one
also accuracy

upbeat prism
upbeat prism
#

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

rich moth
#

what do you guys make of this?

final cobalt
#

Hey smart people!

#

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?

clever current
#

Or maybe I'm out of the loop. I can see why Slack has threads to keep everything together...

clever current
# final cobalt Any thoughts?

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?

glass jetty
#

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?

rich moth
rich moth
glass jetty
#

Hm, I'll take a look, thanks

rich moth
#

np. good luck

glass jetty
#

Ah, but that doesn't work with a ParquetDataset

#

Only with normal datasets, which already support the to_batches() method

lapis sequoia
#

?owner

glass jetty
rich moth
#

!paste

arctic wedgeBOT
#
Pasting large amounts of code

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.

rich moth
#

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

jaunty helm
#

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 train and test separately, the ordinally encoded values might not match
  • if you concat train and test and pass the 1 df in, filling nulls with mean is leaking data from test, StandardScaler() is also leaking cause it sees test data, etc
#

for stuff like StandardScaler(), TruncatedSVD, etc. what you should do is .fit() (and .transform()) on train, and only .transform() on test

final cobalt
#

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

compact monolith
#

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.

final cobalt
#

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?

scarlet anchor
#

Hey, for training ML Models is it feasible to use AWS or amazon sagemaker or saturn cloud?

serene scaffold
scarlet anchor
#

whats the pricing?

serene scaffold
scarlet anchor
#

ok

quaint mulch
# compact monolith

Nice Viz.
This looks like timeseries.
Some easy things are finding correlations, forecasting, anomaly detection, imputation, nowcasting

quaint mulch
clever current
clever current
# compact monolith

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?

final cobalt
#

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?

desert oar
final cobalt
desert oar
#

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.

final cobalt
#

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

final cobalt
#

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.

dry raft
#

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

rich moth
#

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 ?

serene scaffold
rich moth
serene scaffold
# rich moth 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.

clever current
# final cobalt Any thoughts?

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!!!

...

▶ Play video
clever current
#

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

serene scaffold
#

@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.

clever current
#

Yes I know, but I see I can't start threads like you're saying

serene scaffold
#

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.

clever current
#

No problem! Agreed getting all the context is important

compact monolith
#

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.

clever current
#

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

compact monolith
#

Already have that. My question is. Without having a power monitor on EVERY indivudual device, what can I learn from the aggregate deltas?

clever current
#

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?

compact monolith
#

As a human, I can immediately spot the fridges.

#

ML should be able to also.

clever current
#

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.

compact monolith
#

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.

clever current
#

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.

compact monolith
#

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.

thorn pendant
#

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

compact monolith
#

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.

thorn pendant
#

I will say, both to the first question. I am really passionate about programming in general and also the salary attracts me

compact monolith
#

Respect.

thorn pendant
#

do you have like a roadmap to guide me on this path?

compact monolith
#

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.

harsh sun
#

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.

thorn pendant
compact monolith
#

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...

▶ Play video
thorn pendant
#

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

compact monolith
#

If it's up to you, go big.

#

Go far.

#

No horizon.

thorn pendant
#

okay thanks and for the raodamp?

desert oar
#

You might be interested in hierarchical clustering... but I feel like I'm not understanding why this isn't just an image segmentation problem

rich moth
serene scaffold
#

"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

iron basalt
# thorn pendant do you have like a roadmap to guide me on this path?

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.

desert oar
#

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

iron basalt
desert oar
#

Right, I just wouldn't include it on a roadmap for "AI/ML" in general

iron basalt
#

Some people really enjoy that, and so I bring it up as an option since it is its own unique job.

desert oar
#

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

iron basalt
#

In the case of ML, you need the math either way.

final cobalt
#

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?

desert oar
#

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

fading wigeon
#

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?

final cobalt
unkempt wigeon
agile cobalt
#

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

desert oar
#

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

desert oar
# final cobalt Sadly, no. There are two dozen or so frame types, and they've undergone multiple...

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

final cobalt
#

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

desert oar
#

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

final cobalt
#

Here's one example - EX versus EX mega

desert oar
#

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

final cobalt
#

And some examples of how the "basic" frame has changed - a few examples mind you, they change almost every expansion

final cobalt
desert oar
#

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

final cobalt
# desert oar Good. What did you find?

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

desert oar
#

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

final cobalt
#

The images are much smaller, and that's both a blessing and a curse

desert oar
final cobalt
desert oar
#

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

final cobalt
#

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

desert oar
#

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

final cobalt
#

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

desert oar
final cobalt
#

Well

#

The pokemon database has some decently robust anti-bot measures

#

Which means I'm going to need to crawl through it XD

pearl blaze
north adder
#

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

pearl blaze
# pearl blaze

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 ???

north adder
#

i want to know if possible which lagorithms should i read about that might help me solve this

jaunty helm
north adder
#

it compares result with expected result and conclude if positive or negative

jaunty helm
north adder
jaunty helm
jaunty helm
# north adder 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?

jaunty helm
north adder
jaunty helm
north adder
jaunty helm
desert oar
desert oar
pearl blaze
#
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()```
desert oar
#

The fasttext library/tool is a great easy way to do text classification using word2vec-style embeddings

desert oar
pearl blaze
desert oar
#

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

desert oar
desert oar
#

then what? then you modify how the line is constructed in the code, after you know a and b

pearl blaze
dire island
#

Good day, please does anyone know what to do?

final cobalt
#

Where is a good place to host a big dataset of images? (Around 50Gb)

scarlet anchor
upbeat prism
#

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?

serene scaffold
main fox
final cobalt
#

Doesn't Kaggle and HuggingFace have dataset hosting?

unkempt apex
winged turret
#

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.

winged turret
winged turret
#

If anyone could help me solve my problem, I'd appreciate it!

left tartan
winged turret
#

yes

#

at least one of them

left tartan
#

That's going to be fairly hard, since that's dynamically loaded as you scroll through

#

Not a trivial project

winged turret
left tartan
#

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.

worn mountain
#

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

worn mountain
#

if i take mean intensities
python gives 79.7905864197531
matlab gives 79.685138421249505

rich moth
#

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

final cobalt
#

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

final cobalt
#

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?

tepid field
#

Cool

untold fable
#

does sklearn use in industries

#

i mean does chat gpt use that

jaunty helm
#

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

odd meteor
left tartan
# untold fable does sklearn use in industries

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)

untold fable
#

Like talking about the best example of machine learning like YouTube recommendations page

#

Does they use sklearn

untold fable
wooden sail
#

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

serene scaffold
tawdry monolith
#

Can someone suggest me free resource to learn math needed for ml

main fox
serene scaffold
#

pretty much everything since 2022 has been about applying interactive LLMs in different ways.

main fox
serene scaffold
main fox
#

I'm looking for NLP equivalents, in that vein.

serene scaffold
#

@main fox how well do you already understand concepts like neural networks, train/test, and regression

main fox
serene scaffold
#

Because once you get to deployment, the AI stage is over. That's only about software development

main fox
#

I understand what models to use to answer specific questions, limitations of the models, assumptions, why we do train/test, avoiding data leakage

serene scaffold
#

Okay, great

main fox
serene scaffold
#

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.

main fox
#

Thank you 🙂

#

Sounds good, enjoy your workout

serene scaffold
#

Enjoyment is for the weak
To progress is to suffer.

main fox
#

Destroy your body and recover stronger 💪 Get those machine legs that cause quakes with every step

final cobalt
#

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?

serene scaffold
serene scaffold
harsh sun
#

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.

serene scaffold
harsh sun
#

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.

serene scaffold
#

so I would get ahold of instances for every class that the model needs to be able to classify.

harsh sun
serene scaffold
#

also models do not have labels. instances do.

harsh sun
#

I might be messing up the terminology.

#

Instances are the training batches right?

serene scaffold
#

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.

harsh sun
serene scaffold
harsh sun
serene scaffold
#

Do I understand correctly what you want your model to do, or do I not?

harsh sun
#

Because its not necessary as of now the specific location of the ID card

serene scaffold
#

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.

harsh sun
#

That is the goal

serene scaffold
#

that's not a goal. that's an implementation plan.

#

what purpose do you ultimately need for this model to serve?

serene scaffold
#

proof of what concept?

harsh sun
#

checking if someone is wearing their ID

serene scaffold
#

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?

harsh sun
#

I think it would be too difficult to detect whether its their ID

serene scaffold
#

okay, this is a concrete goal

harsh sun
#

Yes

serene scaffold
#

now the first model: what is it trained to do?

#

by the way, this isn't a classification task.

harsh sun
#

An arbitrary yolo pretrained model to detect a wide variety of classes.

harsh sun
serene scaffold
#

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.

harsh sun
harsh sun
#

If I show it a ton of pictures of IDs, wouldnt it train the filters to detect patterns in the IDs themselves?

serene scaffold
#

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

harsh sun
#

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 ...

▶ Play video
iron basalt
#

Its goal is kind of to be a Matlab substitute.

serene grail
iron basalt
#

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...

serene grail
final cobalt
#

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?

blazing urchin
#

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?

upbeat prism
#

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?

desert oar
upbeat prism
# blazing urchin Hello, I am working on a tabular data set that contains various inputs ranging ...

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

desert oar
#

Oh, I misunderstood... yeah definitely don't try a bunch of different models just to see what happens

blazing urchin
grand breach
#

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 ?

river cape
#

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

sterile jacinth
#

anyone is here

serene scaffold
final cobalt
#

Nothing gets you correct information faster than steadfestedly claiming something false XD

river cape
lapis sequoia
#

yes, probably

#

most frameworks let you list or filter trainable layers as well.

versed pilot
desert oar
#

There's also scikit-image

iron basalt
#

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)

trim oxide
#

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?

final cobalt
#

I've got a question for y'all

#

What's a good way to monetize AI quickly and honestly

buoyant vine
#

Sell the shovels

iron basalt
agile cobalt
#

I guess that you can try building a RAG system using internal documents

umbral charm
#

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!

final cobalt
#

Besides - a lot of people have tangential knowledge they'd rather not apply themselves for whatever reason, but might be germane to the question

severe hare
#

Who wants to help me write a NN that can beat anyone in Magick the Gathering?

#

Nobody?

agile cobalt
final cobalt
#

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

faint quail
#

now this is epic (red is true bounding box and green is prediected)

untold fable
#

now i learn pipeling in sklearn

untold fable
#

@faint quail would you share the code

final cobalt
#

Twas a good day sorting pokemon cards

scenic parcel
#

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

wooden sail
#

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)

limpid oak
#

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

scenic parcel
wooden sail
#

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

iron basalt
#

(4 interconnected A100s)

#

(320 GB VRAM)

wooden sail
#

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

scenic parcel
wooden sail
#

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

iron basalt
#

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.

scenic parcel
#

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

iron basalt
#

(Nsight is part of the CUDA toolkit)

scenic parcel
iron basalt
#

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).

iron basalt
#

(Stuck in local minimum)

thorny lintel
#

hey guys, anyone knows how to access gated hf models using tokens using inference APIs ?

wooden sail
strong notch
#

Is someone looking for a project on AI in healthcare? If yes, please DM me.

thorny lintel
upbeat prism
#

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?

untold fable
#

Machine Learning A-Z: AI, Python & R + ChatGPT Prize [2024] hows this course

serene scaffold
untold fable
#

i mean should it worth it

serene scaffold
#

if you have to pay for it, no.

jaunty helm
#

I agree with Stelercus, the course name containing ChatGPT does not give me confidence about its quality

untold fable
#

this is link of my corse

unkempt apex
#

lol you can learn that for free

#

just search about it and read

woven shadow
#

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?

wooden sail
woven shadow
wooden sail
#

you'd have to check the source code for pytorch's autograd to know exactly

woven shadow
#

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

wooden sail
#

with respect to a, sure

woven shadow
#

For univariate functions, how is it done?

wooden sail
#

exactly as you did now

woven shadow
#

for something like ln(a), how would I compute the grad?

wooden sail
#

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

wooden sail
#

you trace the graph in the opposite direction and check the derivative of each node as you go along

woven shadow
#

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?

woven shadow
wooden sail
#

yes

woven shadow
#

or would for sin(a) be cos(a)

wooden sail
#

just let x = a. the letter makes no difference

woven shadow
fallow coyote
#

any good books or tutorials in how to use matplotlib and seaborn?

rich moth
#

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]

faint quail
# untold fable which algorithm you are using

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

desert oar
iron basalt
untold fable
faint quail
# untold fable 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

faint quail
untold fable
#

you use tensorflow to train it

#

and now you want to use pytorch to make it faster

faint quail
merry basalt
#

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?

wooden sail
merry basalt
#

ah yeah

#

thanks for the help

finite thicket
#
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

finite thicket
#

ping me if you respond pls, thanks

woven shadow
#

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

finite thicket
#

just created a new venv and ran pip install vllm mistral_common

unkempt apex
livid gate
#

Is anyone here using Kedro by any chance?
I'd be really interested in your experiences with it and whether you'd recommend it

desert oar
#

That's the most Reddit thread title imaginable

scenic parcel
finite thicket
unkempt wigeon
#

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

unkempt wigeon
#

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

unkempt wigeon
left tartan
#

GPT incorporates many mannerisms, as you'll see from its responses, in an attempt to make it seem more "human".

unkempt wigeon
#

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

unkempt wigeon
scenic parcel
# faint quail 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

faint quail
#

are u like analyzing news articles for predicting stocks?

scenic parcel
#

Yup

#

Never done this before though so results are terrible. So I'm considering embeddings

faint quail
#

dang thats a nice idea

#

good luck

dark slate
#

Has anyone worked with PyTorch?

#

It's just I am not sure I am using the autograd method properly

rich moth
serene scaffold
dark slate
#

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

serene scaffold
#

!code

arctic wedgeBOT
#
Formatting code on Discord

Here's how to format Python code on Discord:

```py
print('Hello world!')
```

These are backticks, not quotes. Check this out if you can't find the backtick key.

For long code samples, you can use our pastebin.

dark slate
#

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?

serene scaffold
#

you usually pick the optimizer you want to use and just step that optimizer.

serene scaffold
# dark slate 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

dark slate
#

instead of optimizing this way manually

#

I should use torch.optim ??

unkempt wigeon
#

Is a histogram optional?

serene scaffold
unkempt wigeon
#

Numerical histogram

rich moth
#

😂 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

unkempt wigeon
#

If I was trying to use a girl Network make one do I truly need to have any type of histogram?

final cobalt
#

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?"

white tartan
#

I am pursuing bachelors in Mathematics and computing can i make future in AI development with this domain?

final cobalt
#

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

dark slate
#

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?

serene scaffold
white tartan
#

like 60% maths 40% cs

serene scaffold
final cobalt
#

Just need to be clear you're not just armchair pontificating

dark slate
#

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

serene scaffold
dark slate
white tartan
serene scaffold
final cobalt
#

Well lemme ask you then, because I'd like to get into the AI biz myself

white tartan
final cobalt
#

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?

white tartan
#

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🥲

serene scaffold
final cobalt
#

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

serene scaffold
white tartan
final cobalt
serene scaffold
white tartan
serene scaffold
quaint mulch
serene scaffold
quaint mulch
serene scaffold
quaint mulch
#

I already maxed out all the degrees, including grad schools

serene scaffold
quaint mulch
#

my master was in teaching, but my PhD is in CS

serene scaffold
quaint mulch
#

I think I'm talking about industry jobs in particular, not academia

serene scaffold
# quaint mulch 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.

odd meteor
fallen gate
#

could you send over your thesis?

#

I am curious

unkempt wigeon
#

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

unkempt wigeon
#

Do I need to use a graph in general for a network to work?

final cobalt
#

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)

left tartan
unkempt wigeon
#

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

final cobalt
#

Anyone here ever use Mutual Information loss?

odd meteor
tulip wyvern
#

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??

charred egret
tulip wyvern
tulip wyvern
# desert oar Who says it can't?

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

charred egret
tulip wyvern
charred egret
#

It won’t treat them as ordinal

#

0 to whatever number

tulip wyvern
#

Wait really??

charred egret
#

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.

tulip wyvern
#

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 ?

tulip wyvern
#

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?

charred egret
tulip wyvern
#

would that solve my issue of the labels having a false relationship ?

#

Sorry I’m just really tripping out about that one small thing

charred egret
charred egret
#

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

tulip wyvern
#

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

rich moth
tulip wyvern
rich moth
desert oar
#

But the "regressor" model will interpret numbers as numbers with an ordinal relationship

tulip wyvern
tulip wyvern
#

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

desert oar
#

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

charred egret
desert oar
#

One hot encoding in a tree based model can be questionable

tulip wyvern
tulip wyvern
#

Sorry I’m new to all this

desert oar
charred egret
#

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

desert oar
tulip wyvern
final cobalt
#

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
            )
        ''')
past meteor
unkempt wigeon
#

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?

desert oar
past meteor
#

Yeah, agreed. Catboost has the same option

#

If you forget setting them as categorical with lightgbm or catboost it becomes ugly though

rich moth
final cobalt
#

Is it just card art, or fan art also?

velvet oak
#

I wanted to learn machine learning, could someone please guide me towards some best resources to learn ML from?

unkempt apex
#

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?

unkempt wigeon
#

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

unkempt wigeon
#

I'm sorry

unkempt wigeon
# serene scaffold 0

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

serene scaffold
unkempt wigeon
#

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

unkempt apex
unkempt wigeon
charred egret
#

Now if the Deep Learning framework you’re using has some CVEs then that’s a different issue

unkempt wigeon
#

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

charred egret
#

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

unkempt wigeon
charred egret
#

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

unkempt wigeon
final cobalt
#

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?

rich moth
#

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]

final cobalt
rich moth
final cobalt
#

What are your needs?

#

Do you just need the images? Or the card text also?

rich moth
final cobalt
#

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

#

And have the cropping done in about as much time

rich moth
#

Good idea, ill check it out. let ya know

unkempt wigeon
#

What is the best use to make a 5 dimensional array for possible looking at a different timeline

left tartan
unkempt wigeon
#

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

left tartan
unkempt wigeon
#

Yes

left tartan
unkempt wigeon
#

Thank you

rich moth
final cobalt
#

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?

untold fable
#

where to learn statics for data science

lapis sequoia
#

Helu can anyone provide the resource for nlp?

rich moth
final cobalt
#

I appreciate the offer, but when I need to I'll just scrape scryfall myself

#

That way I can be sure

rich moth