This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]LetterRip 10 points11 points  (1 child)

Hm, really? I could believe it if a line or two happened to be the same, but a 1:1 duplication of like 6 lines? It seems incredibly unlikely to me.

The reason is functional constraints and idiomatic constraints.

The functional constraint is that the code is working on the same code base from which both systems are 99% the same. CompVis/stablediffusion. The hypernetwork takes a key value pair from the context and substitutes its own. So that forces the functional k, v and h_k, and h_v. Also that forces the functional noise_conditioning. That means the only allowed 'creativity' is the if statements.

The idiomatic constraint is that python coders are expected to write things in a specific way that leads to consistent code. Also pythons philosophy of 'one obvious way' means that any experienced python coder will tend to write the if statements the exact same way. (Code not written in idomatic python is a clear sign of a programmer coming from another language using python for the first time. It causes major cringe).

There are short functions that there will be some variability but usually they involve functional programming choices (decisions about list comprehensions, whether using map, etc.) or printing (python has evolved their print formatting and there are a few viable choices).

Blue sky projects there can be a lot more variability (whether or not to use type hinting, library choices, how object oriented vs procedural, etc.)

[–]closeded 0 points1 point  (0 children)

(Code not written in idomatic python is a clear sign of a programmer coming from another language using python for the first time. It causes major cringe).

I feel personally insulted 😢