« first day (2642 days earlier)      last day (2310 days later) » 
02:00 - 22:0022:00 - 00:00

10:02 PM
Is it possible to view a list of objects created from a class?
 
Yes? but what are you trying to do ? do you have an example of what you are trying to do ?
 
or do I have to create a list manually
 
I don't even think I understand the question
 
can u provide us with a mcve?
 
sorry, one sec.
thought it was a yes or no question
 
10:05 PM
Just unclear
 
main = Tk()

class popup():
    def __init__(self, name):
        self.name = name
    def txtmaker(self):
        txt = Text()
        txt.grid()
        #other stuff
test1 = popup('name')
main.mainloop()
end goal is finding which class object a text widget belongs to
 
what do u mean by which text widget it belongs too ? now I'm not following on what you are asking, sorry
 
@sidnical I'll do you a favor and explain it. You are using python terms ambiguously. What does "view" mean? What does "created from a class" mean? It is unclear what you are trying to do. We use MCVE to reduce ambiguity so that we gain insight into your intentions. Unfortunately, what you originally asked isn't a simple yes or no.
 
im the one not being clear enough so I apologize.
in that case it may be best if I post it as a question instead of here
 
If you're just trying to keep count of the number of instances made by the user, you can use a class-level variable that increments inside the init method
 
10:10 PM
heads-up: if we find your question unclear, so will others on main
so work on it before you post it
 
I guess a more simple question would be is there a list of every object created for a class
 
"every object created for a class" <- unclear
 
I'll put more detail on a posted question
 
if you mean every class instance, it's what Marcus said
but your earlier question sounds otherwise
 
Are you asking how to implement something? Or if Python comes with some "built-in" mechanism for doing what you want?
 
10:12 PM
guess im asking as I think about it
asking if python has something built in that will list every instance created
 
I suggest that you show a handwaving example where for a class you show what "every object created for a class" is
 
so for my example above, i'd like to do something like print(popup.items()) and see test1
 
OK, so probably what Marcus said
if you know you want to keep track of the instances of your class it makes sense to store a list of all instances as a class attribute
 
10:14 PM
right, I just didn't know if that list was already created or if I needed to amke it myself
 
making yourself isn't too hard...
class foo():
    lst = []

    def __init__(self,x):
        self.x = x
        foo.lst.append(self)

    def __repr__(self):
        return str(self.x)

    @classmethod
    def getInstances(self):
        return foo.lst

foo(2)
foo(1)
foo(3)

print(foo.getInstances())
>> [2,1,3]
 
Rawing's link seems to be useful if you want to catch all the instances of any class, like "oh wonder what all the dicts are". If you're working with your own class, Marcus' last link is probably best
 
I know its not hard, I do it for other stuff I want to keep track of. Just didn't want to make a list if one already existed.
 
we don't seem to think there is one :)
(instances don't know about each other, in general)
 
oh btw if you want use a set instead of a list, would be slightly faster, unless order matters too you.
 
10:17 PM
yeah the garbage collector would be slower. i'll do the list or set
 
Faster for what, though
 
^
faster membership testing, right?
 
gotta go fast :D
 
I'm not sure about list.append vs set.add
 
it's not about the appending and adding
 
10:18 PM
it's about the cones
 
it's about getting it back and using it. empathizes on using it. want to use the list/set in the way of modifying the instance of that class
 
I don't understand what you're saying
 
well it's closing time for me. rbrb, night
 
haha
 
tactical retreat :P
rhubarb
 
10:18 PM
indeed
 
@MooingRawr we'll discuss it tomorrow :D
 
@AndrasDeak I edited for you! and if it's still not clear, ping me and I'll clear it for you tomorrow :d
 
.... what was that dear? You say I need to take out the trash? Sorry guys, rbrb for chores... (-:
 
recbg
and rbrb to piR.
 
Thanks for clarifying for me
 
10:25 PM
Now I'm the one guilty of ambiguity. I was play acting as @MooingRawr. I attempted to pretend that my wife was calling me away as a means to avoid an argument that I was losing.

In other words, a joke that fell flat
 
stars are stars
 
Oooh shiny! I didn't see that (-:
 
wim
11:06 PM
      ,
   \  :  /
`. __/ \__ .'
_ _\     /_ _
   /_   _\
 .'  \ /  `.
   /  :  \
      '
4
 
bus cbg
 
11:27 PM
Does anyone know how to do one hot encoding over multiple channels?
Or what that even means?
 
It's the opposite of cold encoding (or hot decoding, you need context)
 
actually, "one hot encoding" is a thing
it's when you have N lines and exactly one of them has 1 and the rest have 0, signaling a choice of 1 from the N possibilities
oh, is that the question?
I thought this was a question concerning one hot encoding
so...yeah, google "one-hot encoding" I guess
 
Oh no
I understand what one hot encoding is.
 
OK then, your question wasn't clear
 
I just don't understand how it can spread over multiple channels.
 
11:30 PM
Is that explicitly in contrast to a single channel? Perhaps the multiple channels refer to the lines in regular one-hot encoding?
 
hmm
 
Staying-late-to-install-Ubuntu cabbage
 
VTC as no MCVE
 
@Jonathan do you mean something like this stackoverflow.com/a/46674199/2336654
 
@piRSquared Actually I've already asked a question about it but it hasn't been 2 days yet, so I haven't posted it here. But please take a look at my profile?
 
11:43 PM
ech
 
I'm not sure if that question in particular is exactly what I'm after.
I mean in the simplest form,
if have a label 4 and I can have a total of 5,
then my one-hot would just be 00010. That's the base case. Now, I'm trying to see what that would mean
if I wanted to do complicate.
to complicate that*
My intuition is the following. I have 3 labels, then all the columns except the last represent one-hot. And the last column would indicate switching to the 3rd label.
For instance [0, 0, 1, 0] and [0, 1, 0, 0] perhaps indicate labels 1 and 2 and if it were [0, 0, 1, 1] then it would be label 3.
I'm not sure if I'm conveying that properly.
 
you want a total of 6 possibilities

1000
0100
0010
1001
0101
0011
 
What do you mean?
If I just want to put each label into a seperate channel, then don't I only need 3?
 
No, I'm trying to understand what labels you have and how you want them encoded
 
what are you trying to do
 
11:58 PM
So, I'm trying to run a fully convolutional network for semantic segmentation and I'm using this customized network from this github: github.com/jakeret/tf_unet
And I have a rgb image and a ground truth.
I have successfully ran the code for just two classes
by creating a binary ground truth where the background is 0 and pixels of interest are 1.
Now I want to increase it to three classes.
So, background pixels are 0, some pixels are 50 and some pixels are 100.
 
02:00 - 22:0022:00 - 00:00

« first day (2642 days earlier)      last day (2310 days later) »