bitfucker

joined 2 years ago
[–] bitfucker@programming.dev 5 points 2 years ago* (last edited 2 years ago) (1 children)

Good

Edit: Oh shit nvm. It still requires dedicated HW (FPGA). This is no different than say, an NPU. But to be fair, they also said the researcher tested the model on traditional GPU too and reduce memory consumption.

[–] bitfucker@programming.dev 2 points 2 years ago* (last edited 2 years ago) (1 children)

No problems. Learning a new concept is not stupid. So you are familiar with C. In C term, you are likely to do something like this:

int a[10] = {0}; // Just imagine this is 0,1,2,etc...
int b[10] = {0};
for (int i=0; i < 10; i++) {
  b[i] = a[i]*2;
}

A 1 to 1 correspondent might looks like ths:

a = range(10) # 0,1,2,etc...
b = []
for x in a:
  b.append(x*2)

However in python, you can then simplify to this:

a = range(10) # Same as before, 0,1,2,etc...
b = [x*2 for x in a]

# This is also works
b = [x*2 for x in [0,1,2,...]]

Remember that list comprehension is used to make a new list, not just iteration. If you want to do something other than making a list from another list, it is better to use iteration. List comprehension is just "syntactic sugar" so to speak. The concept comes from functional programming paradigm.

[–] bitfucker@programming.dev 2 points 2 years ago* (last edited 2 years ago) (5 children)

You can. Whatever the method returns will be the element of that list. So if for example I do this:

def mul(x):
  return x*2

list = [mul(value) for value in range(1,20)]

It will have the same effect. But this:

def mul(x):
  return

list = [mul(value) for value in range(1,20)]

Will just makes the list element all None

Edit to add more: List comprehension works not from the range function. Rather, the range function is returning a list. Hence the name, "list comprehension". You can use any old list for it.

What it did under the hood is that it iterates each element on the list that you specify (the in ...), and applies those to the function that you specify in the very first place. If you are familiar with the concept of Array.map in other languages, this is that. There is also a technical explanation for it if it helps, but it requires more time to explain. Just let me know if you would like to know it.

[–] bitfucker@programming.dev 2 points 2 years ago* (last edited 2 years ago)
[–] bitfucker@programming.dev 2 points 2 years ago (8 children)

List comprehension is not whatever you're doing there. An example of list comprehension:

list = [value*2 for value in range(1, 20)]

See, list comprehension is used to make a list from an existing list. The value of the new list is defined by a function. In this case, the value of a will be 2,4,6, etc.

Your current syntax list[...], is trying to access an element of a list.

[–] bitfucker@programming.dev 2 points 2 years ago

Yep. Already edited my comment too

[–] bitfucker@programming.dev 5 points 2 years ago

I was curious and then trying to edit the contrast, sure enough. This is 3×Modified contrast image

[–] bitfucker@programming.dev 13 points 2 years ago* (last edited 2 years ago) (2 children)

~~It means it isn't there. I don't see the hue either. Which leaves, screen issue.~~

Edit: It seems like a contrast issue? I took the screenshot and modified it contrast value -3× Modified contrast

[–] bitfucker@programming.dev 10 points 2 years ago

Punch cards are gonna be back baby

[–] bitfucker@programming.dev 1 points 2 years ago

This, plus the support of someone important is usually enough motivation for me to get my shit together. And when I feel like my pace is slowing or starting to get tired, we fool around a bit together which helps a lot. But it is of course different from person to person.

[–] bitfucker@programming.dev 11 points 2 years ago (1 children)

Imma upvote just to spite you then

view more: ‹ prev next ›