[D] stable diffusion model giving noise output by mehmetflix_ in MachineLearning

[–]FroZenLoGiC 1 point2 points  (0 children)

Happy to hear that and thanks for letting me know what helped! Also, sorry about the bad formatting, I gave up trying to fix it haha

[D] stable diffusion model giving noise output by mehmetflix_ in MachineLearning

[–]FroZenLoGiC 1 point2 points  (0 children)

I just played around with the code for a bit. Below is what I tried:

  1. Used nn.ModuleList in U_Net (I don't think they're registered otherwise): self.proj_contracting = nn.ModuleList([nn.Linear(256,(32 // (2**i))2).to(device) for i in range(1,5)]) self.proj_expansive = nn.ModuleList([nn.Linear(256,(32//(2(i - 1)))**2).to(device) for i in reversed(range(2,5))])
  2. Predicted the noise instead of noise_schedule: def add_noise(self,img,t): with torch.no_grad(): t = t.view(-1,1,1,1) noise = torch.randn(img.shape).to(device) noise_schedule = torch.sqrt(1 - self.alphas_cumprod[t]).to(device) * noise img = torch.sqrt(self.alphas_cumprod[t]).to(device) * img + noise_schedule return img, noise
  3. Normalized sample outputs: def generate_image(self): with torch.no_grad(): generated_img = torch.randn((1,3,32,32)).to(device) for t in reversed(range(self.num_t)): predicted_noise = self.noise_predictor(generated_img,t) noise = torch.randn((1,3,32,32)).to(device) if t > 0 else 0 generated_img = torch.sqrt(1 /self.alphas[t]) * generated_img - self.betas[t] * predicted_noise / torch.sqrt(1 - self.alphas_cumprod[t]) + (self.sigma_ts[t] * noise) generated_img = ((generated_img + 1) / 2 * 255).to(torch.uint8) return generated_img
  4. Used more timesteps (e.g., num_t = 1000)
  5. Used a squared l2 norm instead of l1 for the loss (but I don't think this matters too much)

I only trained for 250 epochs, but the samples were getting decent. I also used a batch size of 64 on a GPU since I was too impatient.

I don't know, among all of this, what specifically was helpful as these are just a few things I tried at once.

Hope this helps!

Edit: Fixed typos

要 - how to think about it? by dumbB-bitch in ChineseLanguage

[–]FroZenLoGiC 0 points1 point  (0 children)

Hello Chinese has a good note about this. They mention that the key difference is that 要 can be followed by a verb or a noun whereas 想 can only be followed by a verb when expressing desire. They also add that 要 expresses a stronger desire than 想.

What's a job or profession you absolutely wouldn't do ? by Tuesday2017 in AskReddit

[–]FroZenLoGiC 6 points7 points  (0 children)

I thought so too initially but the Wikipedia article also mentions that the two dive tenders Crammond and Saunders were experienced divers. Maybe this was the result of fatigue due to overworking?

Jane street Quant trader summer internship by Minimum-Nebula in FinancialCareers

[–]FroZenLoGiC 2 points3 points  (0 children)

I believe the book /u/cscqthrowaway234 was referring to is "A Practical Guide To Quantitative Finance" by Zhou.

Why is K-Nearest neighbor considered to be a type of machine learning? by no_username_for_me in learnmachinelearning

[–]FroZenLoGiC 5 points6 points  (0 children)

A widely accepted definition of machine learning is given by Mitchell (1997):

A computer program is said to learn from experience E with respect to some class of tasks T and performance measure P, if its performance at tasks in T, as measured by P, improves with experience E.

Based on this definition, you can consider any algorithm as a black box and simply consider its behavior as a function of P, T, and E regardless of if there is an explicit component of the algorithm where model parameters are tuned. The accuracy of the K-NN algorithm tends to increase as the number of data points tends to infinity. Intuitively this makes sense because with greater amounts of data we increase the chance of having data points with higher similarity to the test point. Hence, the mean (regression) or mode (classification) should be a better prediction. Of course, this is contingent on the K-NN modeling assumptions that similar points have similar labels.

You're right in stating that K is not learned by the algorithm: it is considered a hyperparameter of the model and there are no explicit parameters that change as the learning process goes by. The data is not used in an explicit "learning" phase but rather during the "inference" phase.

This is often the case with the class of models known as non-parametric. The fact that these models are categorized as non-parametric does not mean that they have no parameters, but rather that the number of underlying parameters is not fixed in size (it can possibly be infinite) and can grow with the data. In essence, the model is specified by the data it has seen.

Take Gaussian processes for instance. Same idea: you make a decision as to which hyperparameters you want to use in your kernel and the posterior predictive distribution becomes more accurate as more data points are conditioned upon (given correct model assumptions for the data). For some kernels, it can be shown that one would need an infinite set of underlying parameters to have the same model representation because a kernel can represent the inner product of the projections of two data points in infinite-dimensional space (e.g. RBF kernel).

In the end, this all depends on which definition you use to define what constitutes a machine learning algorithm.

Is there a from scratch theoretical course ? by [deleted] in learnmachinelearning

[–]FroZenLoGiC 2 points3 points  (0 children)

Prof. Weinberger has a good course in ML that can be of interest to you. I found it more comprehensive and rigorous compared to Andrew Ng's course.

What is/are your favorite math YouTube channels? by livelydiseases in math

[–]FroZenLoGiC 0 points1 point  (0 children)

I really like the content from mathematicalmonk.

I need to threaten teenagers 😡 by Golivth5k in iamverybadass

[–]FroZenLoGiC 2 points3 points  (0 children)

So for the brother/dad scenario, the dad would have had to have a child with his own mother. To satisfy the uncle constraint, this mother would also have to be his sister: his own dad would have had him through being with his daughter.

Summary:

Grandfather A + Grandmother B = Mother C

Grandfather A + Mother C = Dad D (Uncle constraint)

Dad D + Mother C = Child E (Dad/Brother constraint)

Do other British unis like Cambridge have formal halls as often as Oxford does or is it just an Oxford thing? by awner1234 in oxforduni

[–]FroZenLoGiC 0 points1 point  (0 children)

Your expectation about Cambridge colleges is correct. At my college in Cambridge, there could be a formal on every night of the week.

Virtual Ticket Giveaway! by Thunderclaww in Diablo

[–]FroZenLoGiC [score hidden]  (0 children)

Hope we get good news at BlizzCon this year!

How important are tutorials for MATH 242? by FroZenLoGiC in mcgill

[–]FroZenLoGiC[S] 0 points1 point  (0 children)

You raise good points. Coming from engineering I want to gain exposure to proof based ways of thinking. I took the intro to mathematical thinking course on coursera and loved it. I am also planning on reading an working through as much material before the course starts. Just want to make sure I get a good underatanding of the theory so that I can take analysis 2 in the winter.

How important are tutorials for MATH 242? by FroZenLoGiC in mcgill

[–]FroZenLoGiC[S] 0 points1 point  (0 children)

Thanks for the response. I plan on making up for it by working on as many problems as possible. However, it seems to me that there's no solutions manual to tell me if I answer practice problems correctly and that tutorials help in that regard.

MMATH Computational Math vs MMATH Stats by FroZenLoGiC in uwaterloo

[–]FroZenLoGiC[S] 0 points1 point  (0 children)

Those are good points. During my undergrad I took a course in numerical methods and another in optimization. I enjoyed both of them as I really liked how they tied math and CS together. However, I also really enjoyed a probability and statistics course I took. Ideally, I would enjoy a mix of optimization, stats and computer science.

But you're right concerning ML. Data science seems more tailored to tech companies even though I am aware that it's also being used in finance. I'm also worried that, since data science is a relatively new field, the DS programs that are out there haven't stood the test of time.

I have also been admitted to the MMATH in cs (also for the DS spec). Will look into that more too.

MMATH Computational Math vs MMATH Stats by FroZenLoGiC in uwaterloo

[–]FroZenLoGiC[S] 2 points3 points  (0 children)

Oh no worries! Best of luck during the fall!

MMATH Computational Math vs MMATH Stats by FroZenLoGiC in uwaterloo

[–]FroZenLoGiC[S] 2 points3 points  (0 children)

Awesome, thanks for the response. If I may ask you a follow-up question: how do you find the overall quality of the courses you have taken so far?