« first day (4013 days earlier)      last day (1161 days later) » 

00:31
Hi, I built a neural networks model to classify digits.
model=models.Sequential()
model.add(layers.Conv2D(32,(3,3),activation='relu',input_shape=(150,150,3)))
model.add(layers.MaxPool2D((2,2)))
model.add(layers.Conv2D(64,(3,3),activation='relu',input_shape=(150,150,3)))
model.add(layers.MaxPool2D((2,2)))
model.add(layers.Conv2D(128,(3,3),activation='relu',input_shape=(150,150,3)))
model.add(layers.MaxPool2D((2,2)))
model.add(layers.Conv2D(128,(3,3),activation='relu',input_shape=(150,150,3)))
model.add(layers.MaxPool2D((2,2)))
model.add(layers.Flatten())
model.compile(loss='binary_crossentropy',optimizer=optimizers.RMSprop(),metrics=['acc'])
learn_rate_reductn = ReduceLROnPlateau(monitor = 'val_acc', patience=3, verbose = 1, factor = 0.1, min_lr=0.00001)
data_gen = ImageDataGenerator(
    featurewise_center=False,
    samplewise_center=False,
    featurewise_std_normalization=False,
    samplewise_std_normalization=False,
    zca_whitening=False,
    rotation_range=10,
    zoom_range=0.1,
    width_shift_range=0.1,
    height_shift_range=0.1,
    horizontal_flip=False,
Fitting the model throws an error InvalidArgumentError: input depth must be evenly divisible by filter depth: 1 vs 3
Is there any idea what I am doing wrong here ? Thank you
01:12
cbg
 
4 hours later…
04:58
Cbg
 
1 hour later…
06:21
@YatShan only give input_shape on the first layer, dont give that arg on the other layers
 
3 hours later…
08:57
TIL:
>>> import __hello__
Hello world!
Hello guys,
I'm trying to find the approximate machine precision – that is, the largest number \epsilonϵ such that 1 + \epsilon = 1
1+ϵ=1 within the precision of the calculation.

I tried:
e = 1/10

while e+1 != 1: #e+1 =/= 1 since its 1.1
f = 1
e = 1/2
print(e)


n = float_info.epsilon #inputs the real value of epsilon
print(n) #prints the value of e stored in system


and


eps = 0.1 #setting the value of eps_1 to 0.1
f = 1+eps
while eps <= 0: #eps is less than or equal to 0 - which its not
if abs(1+eps) <= 1.0: #then the absolute value of (1+e) = 1 which is true
@AmnesiaSmith Welcome. Please take a moment to go through the code formatting guide. Chat doesn't do the full markdown functionality, especially for code+text.
There is no epsilon such that 1 + epsilon = 1. If epsilon is a value that can be represented by a float, then 1 + epsilon can also be represented by a float. The epsilon you're looking for would have to be smaller than float_info.epsilon, but python has no way of representing that value
Except, of course:
class Epsilon:
    def __add__(self, other):
        return other
@Aran-Fey This should work since 1 and ϵ are at different float exponents. So the effective precision of 1 is lower than that of ϵ.
>>> 1 + float_info.epsilon == 1
False
So unless I'm misunderstanding what float_info.epsilon is, it's not doable
09:13
That's because it's a different epsilon than what Amnesia is looking for.
float_info.epsilon is "difference between 1.0 and the least value greater than 1.0 that is representable as a float".
Amnesia is calculating the "opposite" it seems, e.g. 1 + 1.1102230246251565e-16 == 1
So how would I loop this function so that it is 1?
*equal to 1
I've tried altering e to 1/2 which simply gives me 0.0
I guess this is a typo: e = 1/2 . It should be e /= 2 instead.
I'm also not sure if starting at e = 1/10 is correct.
My number above comes from starting at e=1.
The instructions were to set e = 0.1 and then loop over the function till e = 1
But my float force is too rusty to answer the last one with confidence.
and then divide by 2
09:26
Ah well then just fix the typo.
Can I ask what the difference between 1/2 and e /=2 is/
The first is always fixed value of 0.5.
The second is half of what you have right now.
ah but basically I'm set "Set epsilon to 0.1
Loop until 1 + epsilon is equal to 1:
Set epsilon to half its current value"
which is why i set e = 0.1 or 1/10
If it's part of your instructions, e=1/10 is fine.
but if i understand correctly python stores this number 1/10 as a lot of binary information like 1.00110011.. etc
09:30
yes, you're dealing with floats here.
Binary floating point numbers.
@MisterMiyagi Oh. That's a weird thing to define a constant for.
The format is a tad more complicated than this, but the basic idea is the same.
I got e as 8.881784197001253e-17 though the real value is 2.220446049250313e-16
I don't think I did the loop correctly
but idk how to set e+1 =1 in a loop
@Aran-Fey TBH I only ever look into these things out of morbid fascination. 🤷‍♂️
@AmnesiaSmith It's not. sys.float_info.epsilon is something else than what you are computing.
09:34
You are computing the largest number for which 1 + n == 1. sys.float_info.epsilon is the smallest number for which 1 + n != 1.
E*2?
OH
that makes sense, thank you so much!
So... how would you actually figure out this epsilon? Constantly dividing by 2 isn't a reliable method, you get different results based on the starting value
I suspect the answer is "you just look at the float spec and figure it out, rather than write any code"
Yeah, I guess one can calculate it.
The major headache is probably understanding the float spec, not the calculation itself.
09:53
I think it's 1.1920928244535389239899814128875732421875E-7. For floats, anyway. Dunno about doubles
10:31
more float shennanigans?
we all float down here.
Maybe we should… double down on that. 😎
My dad likes to complain that I say "I don't know" too much, he's gonna have a field day if I tell him I said something untrue today without even adding a "I think" or similar
What happens in rooms/6 stays in rooms/6.
Unless someone blurts it out to the wild, of course.
10:58
@Aran-Fey I'm tempted to file a bug report arguing there's a missing comma, but they'd probably say it would break backwards compatibility to add it in
 
2 hours later…
12:33
@Aran-Fey How to spot a CS person. Nothing is certain everything is an illusion or a lie or a simplification, there can be no absolute truth only guesses and approximations xD
oh, and here i was thinking that in my case, it was just a sheer lack of self confidence, with a dose of humility added on top.
i guess i can blame CS instead. seems easier.
CS or equivalent ;)
i now actually printed stickers with: Until you provide evidence to the contrary, we'll just assume you used it wrong somehow and put them on the backside of my contact cards. If anybody has a problem I will just hand them these and tell them in case of emergency turn the card xD
12:57
Now that escalated quickly.
 
3 hours later…
15:35
Will 8 digit dates e.g. 20090131 always sort into chronological order with the naive sorted() method?
If these digits are YYYYMMDD then yes.
 
1 hour later…
16:42
@Hakaishin There's one thing I'm certain of, and that's that god did a really poor job programming our universe (:
Light is a particle and a wave? This physics simulation must've been written by an intern
17:02
@Aran-Fey god probably wrote the code in javascript.
17:18
I just started trying to learn javascript and wow what a mess. I quit when I got to the section on for loops. Why can't browsers run python? It's so much cleaner.
for what it's worth, js has a lot of good options too, that were added later in the language. they learnt from their mistakes, but backward compat is always tricky to manage. Additionally, i hear typescript made it a lot better. and there's quite a fascinating history about how it started really
as for python, there are some projects to run it in the browser, but i'd probably suggest js for anything frontend still
17:33
Brython needs to work on it's website for mobile.
17:44
Could this question maybe be added to the canonicals list? The answer from @Michael0x2a is excellent. stackoverflow.com/questions/39740632/…
@AlexWaygood are there many duplicates asked about it?
Friendly reminder that you can also maintain your own personal collection of duplicate targets with this tool. The code's a mess because the author doesn't know his way around JS very well, but hey, the thing works. Most of the time.
@Hakaishin I read this list of alternatives and thought that transcrypt looks nice because it pregenerates all of the .js code for you ahead of time and you don't have to include an entire python interpreter in every page.
but I haven't tried it yet.
@AndrasDeak There was one just now, and I was surprised to see it wasn't on the canonicals list. But fair point — I can't say I've seen that many dupes :)
@Aran-Fey nice!
18:02
Firefox has greeted me with two self-spam tabs on restart. The future is now.

« first day (4013 days earlier)      last day (1161 days later) »