« first day (3422 days earlier)      last day (1526 days later) » 
01:00 - 20:0020:00 - 00:00

8:04 PM
In practice it is throwing guesses at a wall and seeing what sticks with some vague idea what each layer of a network SHOULD be doing and then hoping it actually does that
 
As neural nets are black boxes you can at most say "This layer in theory increases the perceptive field of what we are trying to accomplish but if it actually does that ... we don't know. We just see the results are better. So it must have worked!"
 
also "let's hope nobody changes the tenth pixel in the sixteenth row because that might turn the elephant into a penguin"
 
@AndrasDeak oh, that checks out. :P legit spot on
 
Well that just means your network didn't actually learn what you wanted it to learn
"Oh yeah this network can differentiate Koalas from Lions!" - "Well actually it just managed to differentiate green background from orange ..."
 
8:10 PM
 
Yeah that is how the classification networks work though: It is just a function from ... say 128x128 inputs to ... 10 ... or whatever you'd like to classify. Changing one value in the input of a trained network will have that effect if you know what pixel causes what output to change
That is why a lot of work went into letting networks "learn" that they should not rely on the value of single pixels to get a certain result
But in the end it just means you change the loss function a bit here and there ... maybe throw the output into another network and see how well you fooled them ... there are options
 
credit where it's due: I see plenty of line breaks!
 
wim
that first comprehension is 🤯
it has six names!
 
the more the merrier
 
ao many horribleness in that code.
 
just don't go downvoting it now that it's been thrown shade at
 
8:35 PM
mutable default arg
reinventing set.intersection, inline
inefficiency in condition ordering

I'm going back to werk
 
@wim Seems like your old "import a module after I destroyed the builtins/globals" riddles don't work as intended in 3.8. Apparently the builtins are still accessible after a globals().clear()
 
wim
@Aran-Fey oh, interesting. I wonder what changed
 
I posted our riddle collection in the python discord and they're destroying them. It's kinda scary tbh
 
wim
destroying as in solving quickly?
 
8:42 PM
I think they special-cased it so that the __builtins__ name always remains
yeah
someone apparently managed to create a recursive tuple, too
 
huh
With ctypes?
 
wim
neat, I just segfaulted every attempt on that one
 
dunno. They didn't post their solution
 
wim
link?
 
C API is cheating
 
8:43 PM
@wim to the discord? discord.gg/python
 
wim
Thx. I'll have to check it on the weekend, crazy busy day in the markets today.
 
everything going down?
except Hand Sanitizer Inc. :P
 
wim
hahah
did someone topple #22 yet? sopython.com/wiki/Riddles#1-22
 
Umm... 500mb to update a game that you only played last week
 
not yet, but I'm gonna ask them about it
 
8:52 PM
@Aran-Fey Can confirm on CPython 3.8.0 too
 
>>> import ctypes
>>> t = 0,
>>> ctypes.c_longlong.from_address(id(t)+24).value = id(t)
^ solution for the tuple
 
Hi all, I have a dataframe, and column name called payRange. It has 28000 records and contains mixed values of NAN, 50k-20k, 50K-70K, 26-76. I am trying to clean this data. First, I want to convert into lower case.
>> df['payRange'] = df['payRange'].str.lower()
the above code is working
 
@Aran-Fey nice
It assumes that id(t) is actually a memory address, right? Which I guess is as restrictive as using ctypes at all.
 
>> def lower(x):
x = x.str.lower()
return(x)

when I passed this function, it's not working. Any suggestions
 
@Aran-Fey This is a 404, do you still have them?
 
8:57 PM
@Jason "not working" how?
I suspect you have to pass that function a Series, not a DataFrame
 
@AndrasDeak getting this error "'float' object has no attribute 'str'. I converted the column into string and then pass this function.
 
and it will not mutate the series for you
@Jason then you're doing something you didn't tell us. MCVE please.
 
@Peilonrayz sadly not
 
@wim I spent way too much time on that trying to fold datetimes with daylight savings time and non daylight savings time but couldn't figure it out
 
@Kevin You'll probably be excited to hear that someone solved your recursive tuple problem; see here
Huh, I could've sworn I had editing privileges on the riddles page...
 
9:05 PM
sock?
try logging in with your main
 
I guess I must've logged in with my other account without noticing
...I just realized Kevin already found a partial solution. Pretty sure the new one also has incorrect reference counts, so it might not actually be an improvement
 
@Aran-Fey I don't remember that
 
May 6 '19 at 19:15, by Kevin
>>> import ctypes
>>> x = (1,)
>>> ctypes.pythonapi.PyTuple_SetItem(id(x), 0, id(x))
0
>>> x is x[0]
True
good to know I'm not the only one suffering from amnesia
 
Ah, neat
 
Aran..you may not realise it, but you've got me trapped. I clicked that discord link. D:
Now i can't stop watching these threads with people "helping" people.
 
9:18 PM
Hmm, you think they're doing a bad job helping?
 
2 of the threads seem to be fine. one seems to have spiraled out of control already
 
I have complaints about the quality of the questions, but the answers usually seem fine
maybe I built up some resistance by visiting r/learnpython hahaha
 
I see, i shall chalk it up to an unfortunate exception then
 
I've been on the discord for about 2 days, so it's not like I'm overly familiar with it yet either
 
ahh, how'd you hear about it? ./curious
 
9:20 PM
Most admins seem to know what they're doing, if nothing else
I typed "python discord" into google *shrug*
 
fair enough :P
 
I saw some bad help, but all the helpers knew their stuff.
 
wow, that's a lot of stuff over there.
 
yeah, there's a lot going on. Once you start helping it's hard to stop, because there's always someone needing help
 
Gotta bring your wreath
 
9:39 PM
hey guys, I accidentally managed to assign list to a variable, is there anyway i can undo that binding and return it to its reserved definition without restarting my session
 
delete list
 
list = __builtins__.list
 
you can assign the current list to something else before deleting
^ the builtins way also works just fine
 
Since list is a builtin and your list = whatever assignment is a global, just del list will work fine
 
hmm, didnt know about builtins, does that mean i can just iterate through builtin to get a list of all builtin functions if i wanted
 
9:41 PM
yes
 
@Skyler Try dir() as well. Or dir(__builtins__).
 
FDG
Hi everyone, I'm new to python and get confused some its syntax. Could you point to docs or explain how the following works:

data_table = sqlalchemy.Table('data', metadata, Column('index', Integer))
sqlalchemy.select([data_table]).where(data_table.c.Col_3 is True)

this part "select([data_table])" somehow becomes "SELECT index FROM..."
which methods of data_table object are called ?
 
@FDG This is from the SQL Alchemy library, not core python. You will have to read the docs of that library to understand what is going on here.
 
FDG
Oh, I though it is common syntax of python, thanks
 
(I don't know any database stuff but I find .where(data_table.c.Col_3 is True) very surprising)
 
FDG
9:47 PM
me too :)
 
The only python syntax here is class_instance.function_name(). For details about how that class and function works, you have to read the documentation for them.
(or it might be module.function())
 
reckon .where(data_table.c.Col_3) should have worked just fine?
 
@ParitoshSingh my issue is that there's no protocol for is so you can't override it for your class to be vectorized...
 
@ParitoshSingh depending on the parameter type that the where() function expects.
@AndrasDeak Do you mean there's no dunder function to override is in the same way you can override == with __equal__()?
 
yup
 
9:49 PM
hmm...that's interesting
 
So unless I'm missing something data_table.c.Col_3 is True is either True or False, probably False, and that's something unexpected to put inside anything called .where in my experience. Hopefully I'm just missing something here.
 
@Aran-Fey I've got my_super(type, instance) and my_super(type, type) working. Are there some edge cases I've missed?
Forgot to link the code
 
10:18 PM
I just found out it's clickable 🤦‍♂️
 
10:58 PM
If I have a range of (positive) values from x to y and I want to normalize them all to a range between 0 to 1 I would calculate each value for (x - min) / (max - min) : But what if I still need every minimal value x be minutely separate from 0 (as a 0 value represents "nothing here"), what would be best here ... I thought adding a miniscule small value to (x - min) but is there a value for that like "float.atomicvalue" ...
 
sounds like poor design...
 
More a "mixup" between having 0 representing "nothing" and having a need to do said normalization
for puposes of accuracy
 
>>> np.finfo(np.float64)
finfo(resolution=1e-15, min=-1.7976931348623157e+308, max=1.7976931348623157e+308, dtype=float64)

>>> np.finfo(np.float64).eps
2.220446049250313e-16
>>> np.finfo(np.float64).tiny
2.2250738585072014e-308
I still think madness lies down this path
 
I am also not sure this is working well ...
My problem is that neural nets aren't accurate so if they try to approximate some function with values between 0.9 and 0.902 , a deviation in the area of 0.001 is devastating for the result ... normalizing the values between 0.9 and 0.902 to 0 and 1 lessens the deviation of 0.001 in the output by a large margin - but when having images of rendered models where a value of 0 represents "nothing here" (as it so happens when rendering images) , this normalization screws with the semantics
 
you can't just use a masked array or nans to fill the nothings, can you?
 
11:09 PM
Problem with nans is that I can't multiply a 0 / 1 mask to the tensor after the fact because 0 * nan stays nan ... but after I returned everything to the 0.9 to 0.902 range the nans remain and I need the nans to be 0s again ...
Also that replacement is very likely not differentiable for backpropagation
 
@salbeira you can explicitly turn the nans back into 0s if you need, that's not a problem
 
can nans be detected with n == nan ?
 
no, but with np.isnan() they can
 
yeah but I'd need to do that with 128x128 values in a for loop like that
 
arr[np.isnan(arr)] = 0
 
11:13 PM
huh ... god all these index functions are neat
 
I said "that's not a problem" for a reason :P
 
Though I am still not sure how my network reacts to getting nans as input ... it might result in the weights being calculated to also become nan
 
yup
 
And thus I can throw the network in a dump
 
I wouldn't be surprised if there were existing methodology for this problem...
 
11:17 PM
Me neither but I don't want to ask my superiors on a friday night :-P
 
11:31 PM
I can just pass the mask of non-unimportant values as an additional channel to the network and have it learn that a 0 at these points means "just output 0 there too"
But ... I don't trust neural networks to learn that ... readies his gun ... I don't trust them at all
 
@JossieCalderon ... what does that stand for?
 
Lemon ...
 
11:54 PM
Grids contain Frames in Tkinter. Is this the correct blueprint?
 
01:00 - 20:0020:00 - 00:00

« first day (3422 days earlier)      last day (1526 days later) »