#voice-chat-text-1

1 messages Β· Page 36 of 1

void cedar
#

basically how does code work? is it like for eg in maths if we know the formula we can solve the question...?

#

i got it; I will come back here and will let you guys know how i did it

#

you guys are really awesome

#

i really appreciate the support!

#

what are your thoughts on current market?

#

yeah

#

job

misty sinew
#

where are you from?

void cedar
#

wait, you're not employed yet?

misty sinew
#

bro, you sounds like 30

void cedar
#

youre in college then?

#

bruhhhh i thought youre some senior soft dev (by ur voice)

proper junco
#
def factorial(number):
    for x in range(1,number):
        number = number * x
    return number
void cedar
#

i am a science dude:)

misty sinew
void cedar
misty sinew
void cedar
#

yesss brooo indeed

#

trust me youre a great person!

misty sinew
#

from what did you start?

misty sinew
void cedar
#

i am learning basic py from YT

void cedar
#

thanks for the support

misty sinew
void cedar
#

okay there's one stupid question:

#

how is this going to work, let's say i know a language now, how do I implement it?

#

i want to start with simple and then go on

#

yeah i get

#

i think I eventually will get it, will i?

void cedar
#

i really want to do it, but then i dont know anything:(

misty sinew
void cedar
#

i have started writing a code in vscode from last week

#

that's python

misty sinew
#

start from basics, ig a course from freecodecamp maybe helpful, where the dr chuck teaches the python

#

let me see if I can find it

void cedar
#

are you a dev?

misty sinew
#

Ik this one is old, but believe me this will be helpful

void cedar
#

thanks

#

are you from asia?

misty sinew
void cedar
#

I am learning python from a national dev

misty sinew
#

aah that's good

void cedar
#

and I feel like he also does explain better

misty sinew
#

then at what point you're feeling that you're lost?

void cedar
#

im just confused with my uni and my own learning

#

I want to learn python first

#

and then I will focus on java

#

i feel like i will be left behind if i learn java as they say

misty sinew
#

Aah this syllabus sucks, fr me it was same, ig Java and (CPP or C#) both were in one semester

misty sinew
void cedar
#

hmm

#

thank you so much for talking with me

misty sinew
#

in simple words, have you played valorant?

void cedar
#

yeah

misty sinew
#

counter strike?

void cedar
#

:)))

misty sinew
#

call of duty?

void cedar
#

yep

#

yep

misty sinew
#

see if you know shooting on head, then you can do it in every game, but each and every game has different layout and different sensitivity you've to know and learn to control it.

void cedar
#

are you employed?

misty sinew
#

@void cedar do you have any other questions?

#

ping me if you have any.

proper ridge
#

!paste

coarse hearthBOT
#
Pasting large amounts of code

If your code is too long to fit in a codeblock in Discord, you can paste your code here:
https://paste.pythondiscord.com/

After pasting your code, save it by clicking the Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.

lunar salmon
#
class Admin:
    def __init__(self):
        self.name = "Shayan"
        self.age = "23"
        self.__access = "root"
    def get_access(self):
        return self.__access
    def set_access(self, new):
        self.__access = new

admin = Admin()


print(admin.name)
print(admin.age)
print(admin.get_access())

print("-------------------------")

age = 25
name = "Borzu"
Admin().set_access("user")


print(admin.name)
print(admin.age)
print(admin.get_access())
proper ridge
#

Likewise, have a nice day!

lunar salmon
#
class Name:
    def __init__(self, first_name, last_name):
        self.first_name = first_name
        self.last_name = last_name
    
    def answer(self):
        return f"{self.first_name} {self.last_name}"
    
    @classmethod
    def splitter(cls, strng):
        first_name, last_name = strng.split()
        return cls(first_name, last_name)


name = Name.spliter("Shin Ryuko")



print(name.answer())
hoary citrus
#

class = cls

proper junco
lunar salmon
proper ridge
#
     def _non_parameterized_single_qubit_gate(self,
                                              gate: Literal["I", "X", "Y", "Z", "H", "S", "T"],
                                              qubit_indices: int | Collection[int]) -> None:
         # Define the gate mapping for the non-parameterized single qubit gates
         gate_mapping = {
             "I": I,
             "X": X,
             "Y": Y,
             "Z": Z,
             "H": H,
             "S": S,
             "T": T
         }

         # Apply the gate to the specified qubit(s)
         if isinstance(qubit_indices, Collection):
             for index in qubit_indices:
                 self.circuit.append(gate_mapping[gate](self.qr[index]))
         else:
             self.circuit.append(gate_mapping[gate](self.qr[qubit_indices]))

     def _parameterized_single_qubit_gate(self,
                                          gate: Literal["RX", "RY", "RZ"],
                                          angle: float,
                                          qubit_index: int) -> None:
         # Define the gate mapping for the parameterized single qubit gates
         gate_mapping = {
             "RX": Rx(rads=angle),
             "RY": Ry(rads=angle),
             "RZ": Rz(rads=angle),
         }

         # Apply the gate to the specified qubit
         self.circuit.append(gate_mapping[gate](self.qr[qubit_index]))
#
def _single_qubit_gate(self,
                           gate: Literal["I", "X", "Y", "Z", "H", "S", "T", "RX", "RY", "RZ"],
                           qubit_indices: int | Collection[int],
                           angle: float=0) -> None:
        # Define the gate mapping for the non-parameterized single qubit gates
        gate_mapping = {
            "I": I,
            "X": X,
            "Y": Y,
            "Z": Z,
            "H": H,
            "S": S,
            "T": T,
            "RX": Rx(rads=angle),
            "RY": Ry(rads=angle),
            "RZ": Rz(rads=angle)
        }

        # Apply the gate to the specified qubit(s)
        if isinstance(qubit_indices, Collection):
            for index in qubit_indices:
                self.circuit.append(gate_mapping[gate](self.qr[index]))
        else:
            self.circuit.append(gate_mapping[gate](self.qr[qubit_indices]))
#

@delicate wren alisa, is the new abstraction a good change or did I overdo it?

#

It works, and passes mypy, but as you mentioned before it's not an indicator of good code.

delicate wren
proper ridge
hoary citrus
thin lintel
proper ridge
#

Does it come with the flashy nose?

thin lintel
#

Dried reindeer meat. It is a traditional food and a delicacy of Northern Finland, prepared at springtime. Like jerky, of which kuivaliha is a variant of, its origins lie in the need for food preservation. Kuivaliha is a very useful snack when camping, etc., for its light weight and good nutrition values.

umbral rose
# thin lintel

All I want for Christmas is one of Santa's reindeer πŸ˜‹

sly pond
proper junco
umbral rose
#

Back in a bit. Gotta bathe these grubby kids.

thin lintel
stuck bluff
#

Metal detector use here requires a mining license.

#

Use.

#

I may be misinformed.

#

Premium Burials.

sly pond
stuck bluff
#

It would have to be a bit of an indictment against the competency of doctors of the time.

#

Well don't they have that hammer thing with the pope? Or is it a spoon? i can't remember.

thin lintel
#

The corpse is placed in a cypress wood coffin, meant to signify humility and refer to the fact that the pope was an ordinary man first. Papal items, including palliums, or lambswool stoles, coins and medals minted during the individual's pontificate, are also placed in the casket

proper ridge
stuck bluff
#

We have a number of night noise animals here.

#

Foxes, possums and alpacas.

#

Bats, occasional birds.

#

A species of owl.

#

Which I've never seen, but heard.

proper ridge
#

I'm gonna take a break, brb.

stuck bluff
#

We have a very quiet bird.

#

Flew right past me, once.

thin lintel
#

very noisy

stuck bluff
#

Didn't hear it, felt the air. The air felt soft.

thin lintel
#

also noisy

stuck bluff
#

You see some images of these birds on logs and stuff, and unless you know they're there, they can be very difficult to spot.

thin lintel
#

also swallows

stuck bluff
#

Looks fast.

#

Dusks and dawns often are graced by a chorus of kookaburras, where I am.

#

Also Australian magpies.

#

...and all the others, of course.

#

Sometimes the magpies get confused at the moon.

#

Bye bye

proper ridge
proper ridge
misty sinew
#

it's so silence

proper ridge
#

qubit

versed elk
#

qubits

proper ridge
hoary citrus
#

@tropic sigil hi

#

I am learning python for machine learning

#

Learning python

sly pond
#

morning

#

us

#

it's early

#

take out the z's

#

a lot easier

#

then think about hte movie frozen

#

πŸ‘

#

it's early

#

I'm gonna go make coffee, I do have an earbud in, so I am listening

#

it is life

#

so cybersec, what drew you in?

hoary citrus
#

what?

#

yes

sly pond
#

Yea, coffee maker is downstairs

#

Yea, I'm pretty quiet in the morning, it's why I'll often just type

#

gotta have the coffe and wake up

hoary citrus
#

You are from India right?

#

Pakistan

sly pond
#

Ooh, permanent besties!

#

Geopolitical dance rivals

#

Did you see break is in the olympics?

#

I wonder if India and Pakistan entered, and if they did, it would be an amazing final

#

no

#

rarely

#

Have you changed your diet?

#

new medicines?

#

stopped anything?

#

well then...

#

I think that's the cause, you're not comfortable in your sleeping environment

hoary citrus
#

no I am not

#

πŸ˜‚

sly pond
#

self fulfilling prophecy

#

yes

#

a voice

#

morning quiet

#

normally not so quiet

hoary citrus
#

Yes it is a fact

#

What he said?

#

same

#

Is your profile pic a solar eclipse?

#

Nice

hoary citrus
hoary citrus
sly pond
#

a few minutes

#

here's the 2nd one

hoary citrus
#

That cloud didnt go

sly pond
#

The cloud came in at like noon

#

and got thicker and thicker

#

and ruined things, but in 2017 it was a sunny sky

#

though totality was nearly a minute shorter

#

Went to Charlotte for that one, and that's where I took my profile pic

hoary citrus
#

Okay

#

you were typing

sly pond
#

editing

#

then completed the edit

#

though maybe I was typing, I do sometimes hit the key and delete

hoary citrus
#

everyone do this

sly pond
#

I missed that

hoary citrus
#

Are you proggamming or not that is what he said

sly pond
#

I did not hear waht you had said

#

is all

#

mostly nothing

hoary citrus
sly pond
#

catching up on the news

#

updates on the election

#

wild news day

hoary citrus
#

there are elections in us?

sly pond
#

there will be later this year

#

but my US news tab is very empty

#

only one story in there

#

Apparently nothign else has happened in the US this weekend

stuck bluff
#

Evening.

#

Already gone? I imagine not.

#

Is a fire over when someone stops lighting it?

sly pond
stuck bluff
#

What actually happened almost doesn't matter. What we need to look at is what effect it will have.

#

Hm. I don't know what happened. I have thoughts.

#

Tbf, they make conspiracy theories very easy.

#

Sorry, the shooter was what?

proper ridge
# sly pond

You're right, you don't even need a sniper to see the guy. I'm sort of wondering how he missed the shot from that close.

stuck bluff
#

Also, what was with the secret service just letting Trump just stand around pumping his fist? Like, your guy just got shot and you're not forcing him off the stage?

sly pond
#

well

#

sniper is dead

#

swiss cheese at that point

stuck bluff
#

Did they know it was the only one?

#

In that moment.

#

Did they know?

#

"Yeah, it's cool, just let your face stick out."

#

How was his reaction normal?

#

Like, if I get shot at, I'm pissing my pants and freezing.

stuck bluff
#

Or maybe not. I might just blank. I don't hope to ever find out.

sly pond
#

❀️ bingbot

thin lintel
#

herschel walker

sly pond
#

The Republican candidate for the US Senate seat in Georgia, Herschel Walker, says during a speech in the town of McDonough that 'vampires are cool people'. Subscribe to Guardian News on YouTube β–Ί http://bit.ly/guardianwiressub

The former football star says during rambling remarks: ''I don’t want to be a vampire any more. I want to be a werewolf...

β–Ά Play video
stuck bluff
#

Awareness?

#

I mean, it's right there.

#

Oh, men being clueless I can kind of get.

thin lintel
sly pond
#

gonna run

fair heron
hoary citrus
#

@fast path hi

versed lava
#

@sly pond i know where you're from as long as your nickname is your name

#

are you from

#

P-O-L-A-N-D

#

did I guess?

sly pond
#

kinda

versed lava
#

i'm from Poland too

#

nice to meet you

hoary citrus
versed lava
#

maybe he comes from Poland, but he lives in the US

hoary citrus
#

maybe

sly pond
#

Live in the US, most my life

versed lava
#

From now on call me detective.

#

πŸ˜‰

primal mason
#

pooja

#

sxx

tranquil drift
#

yessir

proper ridge
stuck bluff
delicate wren
#

huh

#

Russian SCP fork uses Rust+Python for the backend

stuck bluff
delicate wren
proper ridge
stuck bluff
#

@cursive glen πŸ‘‹

#

@gusty ether πŸ‘‹

gusty ether
#

πŸ‘‹

wide cargo
#

hola

grand iris
#

@stuck bluff hi

#

i need help with installing intellij

stuck bluff
#

I'm not useful, there.

grand iris
#

can i screen share

mild flume
#

!stream 1115939192141266954

coarse hearthBOT
#

βœ… @grand iris can now stream until <t:1721060823:f>.

buoyant dagger
#

!e

import random

random_choice = random.randint(0, 1)

if random_choice == 1:
  print("Heads")
elif random_choice == 0:
  print("Tails")
coarse hearthBOT
grand iris
#

thanks ppl

buoyant dagger
#

!e

names = ["Angela", "Ben", "Jenny", "Michael", "Chloe"]

import random

# Get the total numbers of items in list.
num_items = len(names)

# Generate random numbers between 0 and the last index.
random_choice = random.randint(0, num_items - 1)

# Choose and print a random name.
print(f"{names[random_choice]} is going to buy the meal today!")
coarse hearthBOT
wary fable
#

@raven orbit

coarse hearthBOT
#

random.choice(seq)```
Return a random element from the non-empty sequence *seq*. If *seq* is empty, raises [`IndexError`](https://docs.python.org/3/library/exceptions.html#IndexError).
buoyant dagger
delicate wren
#

!random.randrange

#

r

#

!d random.randrange

coarse hearthBOT
#

random.randrange(stop)``````py

random.randrange(start, stop[, step])```
Return a randomly selected element from `range(start, stop, step)`.

This is roughly equivalent to `choice(range(start, stop, step))` but supports arbitrarily large ranges and is optimized for common cases.

The positional argument pattern matches the [`range()`](https://docs.python.org/3/library/stdtypes.html#range) function.

Keyword arguments should not be used because they can be interpreted in unexpected ways. For example `randrange(start=100)` is interpreted as `randrange(0, 100, 1)`.

Changed in version 3.2: [`randrange()`](https://docs.python.org/3/library/random.html#random.randrange) is more sophisticated about producing equally distributed values. Formerly it used a style like `int(random()*n)` which could produce slightly uneven distributions.
buoyant dagger
#

!e

import random

names = ["Angela", "Ben", "Jenny", "Michael", "Chloe"]

# Get the total number of items in the list.
num_items = len(names)

# Generate a random number.
random_choice = random.randrange(num_items)

# Choose and print a random name.
print(f"{names[random_choice]} is going to buy the meal today!")
coarse hearthBOT
buoyant dagger
#

!e

import random

names = ["Angela", "Ben", "Jenny", "Michael", "Chloe"]
random_choice = random.randrange(len(names))

print(f"{names[random_choice]} is going to buy the meal today!")
coarse hearthBOT
misty sinew
#

hey!

#

yea, I do...

#

oh god, I forgot your username... I can't ping you...

#

I'm new to the server so can't speak in the VC right now...

#

come back...😭

#

hello @stuck bluff

#

I can't speak ;-;

stuck bluff
misty sinew
#

Yea, I gotta spend more time here ig...

#

bruh, I can't even type in the VC room 1 chat lol!

#

should I share my screen? You guys can help me correct my mistakes... @stuck bluff @proper ridge

stuck bluff
#

@misty sinew πŸ‘‹

misty sinew
#

ah! I see... So how do I "interact" with the returned value?

#

oooh... I wrote a code which does not require the return keyword but I can interact with the defined functions regardless.... Can you explain ti me why does that work?

#

wait, I'll copy and paste the code

#

def happy_bday():
print("HAPPY BDAY!")
print(f"enjoy being X years old")
print() # <=====to leave a line... makes the code look tidy, nothing else.

happy_bday()
happy_bday()

#So. What did we do here?
#Well, we "defined" a functin called happy bday since we had to compile it multiple times(Don't ask why, I don't fucking know.)
#How to define a function: def function():
# print("whatever u want it to say")

def happy_bday(name, age): #here, we've defined a perameter
print(f"HAPPY BDAY, {name}")
print(f"enjoy being {age} years old")
print()

happy_bday("Pranjal",19) #here, we've assinged the name parameter a "value"
happy_bday("Samarth",19)
happy_bday("some random guy",1000000)
#----------------------------------------------------------------------------------------------------------------------------------

#Let's fuck it up a little, shall we? πŸ˜‰

def happy_bday(age, name):
print(f"HAPPY BDAY, {name}")
print(f"enjoy being {age} years old")
print()

#

.

I make my notes in VS code so it's elaborated...

#

yep

#

I mean, I can call and change the defined functions by doinf this too... wait.., what do you mean by that? "it is meant to print somethin and not get info out of it" I didn't get that.... @stuck bluff

#

I'm so dumb... ;-;

#

ah... I see

#

hmmm

#

ok... I'll need some time to figure that out... Bruh, you guys are so smart! me scared :3

misty sinew
#

I shall apply myself.

#

Damn, you sound so wise! It's nice to find ppl who can guide me!

#

Thank you so much! ❀️

#

haha!

#

you read philosophy?

#

Are you a professor at some uni? You sound like one... Most of the ppl I've asked help from just ignore me or laugh at my face.... or, my screen... ok, that was a bad joke

#

I'm sure that I won't be the last lol

#

abyway, gtg... let's hope that the next time I'm here, my voice wouldn't be supressed by the evils of this world....

#

[Lightning strike to make it look more dramatic]

#

k, bye!

distant nova
#

damn

#

i love philiosphy

#

it's great

hearty heath
#

No worries πŸ˜„

proper ridge
#

!paste

hearty heath
#

Let me take a quick look at the code, one sec.

misty sinew
#

couldn't hear you, could you say that again?

#

oh, Hello

#

hello

hearty heath
#

So the wrapping function just checks some stuff before calling the wrapped method?

#

Why do you use Sequence? Just for generality?

#

Do the methods mutate the data?

proper ridge
#
def _single_qubit_gate(self,
                           gate: Literal["I", "X", "Y", "Z", "H", "S", "T", "RX", "RY", "RZ"],
                           qubit_indices: int | Sequence[int],
                           angle: float=0) -> None:
        # Define the gate mapping for the non-parameterized single qubit gates
        gate_mapping = {
            "I": I,
            "X": X,
            "Y": Y,
            "Z": Z,
            "H": H,
            "S": S,
            "T": T,
            "RX": Rx(rads=angle),
            "RY": Ry(rads=angle),
            "RZ": Rz(rads=angle)
        }

        # Apply the gate to the specified qubit(s)
        if isinstance(qubit_indices, Sequence):
            for index in qubit_indices:
                self.circuit.append(gate_mapping[gate](self.qr[index]))
        else:
            self.circuit.append(gate_mapping[gate](self.qr[qubit_indices]))
#

__len__, __getitem__, and __iter__.

wary fable
#

No mic today, in a quiet zone

proper ridge
#

Final goal is to have the qubit_indices of the decorated methods to be int | Sequence[int].

#

The gate methods themselves don't mutate the qubit_indices. I only need mutability for self.circuit_log because I mutate that in self.vertical_reverse() for instance.

hearty heath
#

Hey Opal

wary fable
#

Hey Opal

hearty heath
#

I am confused sorry πŸ˜„

wary fable
#

Time to find out how out-of-date the library is

#

How many of these seem good?

hearty heath
#

The wrapper returned by the decorator doesn't have a different signature from the function it's wrapping right?

proper ridge
#
def X(self,
      qubit_indices: int | Sequence[int]):
    ...

@gatemethod
def X(self,
      qubit_indices: int | list[int]):
    ...
wary fable
#

Vc0 is full of streamer brainrot lol

#

Some of these books aren't as useful as others lol

#

And some I kinda want a copy for myself lol

#

It usually gets taught alongside sed

#

Oh boy

#

Some of these books are OLD

misty sinew
#

Hello

stuck bluff
#

@gusty ether @misty sinew πŸ‘‹

wary fable
#

Pretty sure this is pre-json

gusty ether
#

πŸ‘‹

wary fable
#

Trying to see if they have a copy of "Hating on Languages You Don't Use"

#

Settled on these three for this week. The library card is such an unsung hero when you are on a budget.

hearty heath
#

So as I understand it, your intention with the decorator is to return a wrapper function (with the same signature as the wrapped function) that basically checks some stuff and does some logging, and then calls the wrapped function? It shouldn't matter what the wrapping function does to values it's passed, as long as it's not trying to do things that can't be done to values of their type πŸ€” Have you learned about using ParamSpec to type hint decorators? https://www.youtube.com/watch?v=fwZoxWyMGM8

#

But I agree with Opal. Keep it simple πŸ˜„

proper ridge
#

!zen

coarse hearthBOT
#
The Zen of Python, by Tim Peters

Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than right now.
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea -- let's do more of those!

uneven python
# proper ridge ``` def X(self, qubit_indices: int | Sequence[int]): ... @gatemethod ...

if the decorator is the same as we talked about earlier, you'd typehint qubit_indices as list[int]. the @gatemethod would then return something expecting a int | Sequence[int]
(to be fair, i think just having it inside the method definition could be easier, because then you dont need decorators for each signature. but its an interesting problem anyways)

gusty ether
#

is there a situation where you can say typing is additional work and slows you down in development when you need to move fast?

hearty heath
#

Type hinting should be secondary when writing Python code in my opinion.

#

Although it can help guide the design of your code

uneven python
proper ridge
hearty heath
#

Type hinting can be fun though. It's like solving little puzzles πŸ˜„

proper ridge
#

You know, since it's just a checker for values, and just logs the params, what if I just put it inside instead of using it as a decorator?

uneven python
proper ridge
#

I honestly want to write this in a clean manner.

hearty heath
#

Yeah sorry @proper ridge I'm not really familiar enough with the code, so I don't really understand what's going on. I recommend watching that video I linked if you're generally usure about how to go about type-hinting decorators with wrapping functions.

uneven python
#

use haskell for 10 minutes will learn more than from any video about typehinting

proper ridge
uneven python
#

nah solving type problems is my hobby

hearty heath
#

Sorry, just going to check in on vc0 for a sec

proper ridge
proper ridge
gusty ether
#

typing vs comments: maybe we use typing if we don't want to add comments on small chunks of functions? hehe

buoyant dagger
#

!e

target = 100
for number in range(1, target + 1):
  if number % 3 == 0 and number % 5 == 0:
    print("FizzBuzz")
  elif number % 3 == 0:
    print("Fizz")
  elif number % 5 == 0:
    print("Buzz")
  else:
    print(number)
coarse hearthBOT
proper ridge
#

!zen

coarse hearthBOT
#
The Zen of Python, by Tim Peters

Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than right now.
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea -- let's do more of those!

misty sinew
#

The code I wrote 2-3 years ago, now whenever I read that code. I'm like when did I write this code huh, it can be done in this in the easiest and shortest way.
it's true we need practice

keen orbit
#

i cannot speaketh

stuck bluff
buoyant dagger
#

!e

#Password Generator Project
import random
letters = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']
numbers = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
symbols = ['!', '#', '$', '%', '&', '(', ')', '*', '+']

print("Welcome to the PyPassword Generator!")
# nr_letters = int(input("How many letters would you like in your password?\n"))
nr_letters = 12
# nr_symbols = int(input(f"How many symbols would you like?\n"))
nr_symbols = 8
# nr_numbers = int(input(f"How many numbers would you like?\n"))
nr_numbers = 4

password_list = [""]
for char in range(1, nr_letters + 1):
    password_list.append(random.choice(letters))

for char in range(1, nr_symbols + 1):
    password_list.append(random.choice(symbols))

for char in range(1, nr_numbers + 1):
    password_list.append(random.choice(numbers))

random.shuffle(password_list)

password = ""
for char in password_list:
    password += char

print(f"Your password is: {password}")
coarse hearthBOT
proper ridge
#

!pypi qoin

coarse hearthBOT
#

Quantum Random Number Generator.

Released on <t:1713438701:D>.

stuck bluff
#

@white oyster πŸ‘‹

#

@eternal orchid πŸ‘‹

white oyster
scenic echo
obtuse valve
#

guess whos baccc

distant nova
#

cute lady bug?

hoary citrus
#

@obtuse valve Everyone say pytorch is best

obtuse valve
#

depends on your compute limits i guess

#

eg you can have a "jetson nano" and you can claim that it's a "tensor processing unit"

#

alternately you can use distillation i guess

#

but then again, what is your compute requirements

#

"edge compute"

#

reinforcemen tklearning whoohohohohohohohohohoohjohohhoho

hoary citrus
#

See ya guys

obtuse valve
#

seeya

hoary citrus
#

GN

obtuse valve
#

gn

#

lol the wifi in the attic sucks

#

iirc mr hemlock told me that it was default in rotterdam

obtuse valve
distant nova
#

how can i

#

actually like

#

check my

#

messages typed

#

amount

hearty heath
#

But make sure not to spam messages!

stuck bluff
#

@south flame πŸ‘‹

south flame
#

hi

#

i cant speek, how can i voice verif ?

stuck bluff
south flame
#

okey

stuck bluff
#

@rough pasture πŸ‘‹

rough pasture
#

Hi @stuck bluff

south flame
#

i leave 30min

rough pasture
#

I don't have a permission to speak! How can get that?

south flame
rough pasture
#

Thanks man @south flame

stuck bluff
#

@misty sinew πŸ‘‹

#

@mellow pollen πŸ‘‹

south flame
proper junco
stuck bluff
#

@fiery sage πŸ‘‹

fiery sage
#

πŸ‘‹

stuck bluff
#

@paper raptor πŸ‘‹

paper raptor
south flame
#

Im comeback ! πŸ™‚

#

i have a bad connection

#

i will restart my internet box

proper junco
#
text[:,1] = [x-min(text[:,1]) for x in text[:,1]]
text[:,1] = [x/max(text[:,1]) for x in text[:,1]]```
dry pendant
#

import numpy as np

create an array

data = np.array([[12, 29], [33, 50],
[5, 15], [0, 10]])

normalized_data = (data-np.min(data))/(np.max(data)-np.min(data))

normalized data using min max value

print(normalized_data)

stuck bluff
#

!e py import numpy as np arr = np.array([50, 2, 12]) arr = arr - arr.min() arr = arr / arr.max() print(arr)

coarse hearthBOT
proper junco
vocal stream
#

yo

proper junco
vocal stream
#

@proper junco If your low-income in the Us it helps 10000%

#

college affordability eu vs us

#

I joined late mb

#

I dont have vc unlocked yet xd

#

@dry pendant whats the startup concept?

#

you can talk i can hear you if you want or you can type

dry pendant
#

it's what I'm working on tonight and for the last 3 years.

vocal stream
#

Ignore my non-sense messages trying to get up to 50 without spamming chats

#

yes

dry pendant
#

I'm trying to find out what people want and how much they would pay for on-demand concept based learning.

delicate wren
#

@dry pendant keyboard sounds are quite loud; do you have Krisp enabled?

misty sinew
#

hi @delicate wren

dry pendant
#

didn't know that was a thing.

vocal stream
#

We love the asmr keyboard

dry pendant
#

I'll see

vocal stream
#

do what

dry pendant
vocal stream
#

@dry pendant keep the same settings you had before and just lower ur sensitivity

#

your mic got worse

#

you can go into voice settings and just lower the bar to where you keyboard isnt picked up

delicate wren
vocal stream
#

the mic is muffled somewhat

vocal stream
delicate wren
#

not if it's that loud

vocal stream
#

maybe

#

i see what youre saying

#

my keyboard is super loud but discord normally can tell since its farther from the mic

#

@proper junco live coding may be able to?

#

or no

delicate wren
vocal stream
#

ah rip

misty sinew
#

I can't stream in any channel..

vocal stream
delicate wren
#

!source video

coarse hearthBOT
#
Bad argument

Unable to convert 'video' to valid command, tag, or Cog.

delicate wren
#

hmm

proper junco
delicate wren
#

!d numpy.fft.fft

coarse hearthBOT
#

fft.fft(a, n=None, axis=-1, norm=None, out=None)```
Compute the one\-dimensional discrete Fourier Transform.

This function computes the one\-dimensional *n*\-point discrete Fourier Transform (DFT) with the efficient Fast Fourier Transform (FFT) algorithm \[CT].
vocal stream
#

quite simple yes πŸ€”

misty sinew
#

I gotta get back to work. Take care guys :p

vocal stream
#

byebye

delicate wren
#

FFT sounds like a dumb and straightforward way to estimate the offset

#

(though ig that's not the problem being solved)

vocal stream
#

is there a reason screenshot isnt enabled anywhere? @delicate wren

delicate wren
#

there's also a problem that it's different scale, right?

#

as in count of points

#

they don't align, right?

#

interpolation is needed anyway

dry pendant
vocal stream
#

Oh im not trying to screenshare

#

I was just wondering why its disabled

#

feel like it could be useful to help etc

delicate wren
vocal stream
delicate wren
#

you can make a function that does that

#

!e

def try_(f, except_):
    try:
        return f_()
    except Exception:
        return except_

print(try_(lambda: 1/0, "error"))
coarse hearthBOT
delicate wren
#

!e

import numpy as np
import matplotlib.pyplot as plt
x = np.linspace(-np.pi, np.pi, 100)
xp = np.linspace(-np.pi, np.pi, 10)
fp = np.sin(xp)
f = np.interp(x, xp, fp)
plt.plot(x, f)
plt.savefig('out.png')
coarse hearthBOT
delicate wren
#

!e

import numpy as np
import matplotlib.pyplot as plt
x = np.linspace(-4, 4, 100)
xp = np.linspace(-np.pi, np.pi, 10)
fp = np.sin(xp)
f = np.interp(x, xp, fp)
print(f)
coarse hearthBOT
# delicate wren !e ```py import numpy as np import matplotlib.pyplot as plt x = np.linspace(-4, ...

:white_check_mark: Your 3.12 eval job has completed with return code 0.

001 | [-1.22464680e-16 -1.22464680e-16 -1.22464680e-16 -1.22464680e-16
002 |  -1.22464680e-16 -1.22464680e-16 -1.22464680e-16 -1.22464680e-16
003 |  -1.22464680e-16 -1.22464680e-16 -1.22464680e-16 -2.80651313e-02
004 |  -1.02467186e-01 -1.76869241e-01 -2.51271296e-01 -3.25673351e-01
005 |  -4.00075406e-01 -4.74477460e-01 -5.48879515e-01 -6.23281570e-01
006 |  -6.71997169e-01 -7.11585676e-01 -7.51174182e-01 -7.90762689e-01
007 |  -8.30351195e-01 -8.69939702e-01 -9.09528208e-01 -9.49116715e-01
008 |  -9.83454176e-01 -9.69705232e-01 -9.55956288e-01 -9.42207344e-01
009 |  -9.28458400e-01 -9.14709456e-01 -9.00960512e-01 -8.87211568e-01
010 |  -8.73462624e-01 -8.38181399e-01 -7.77528288e-01 -7.16875177e-01
... (truncated - too many lines)

Full output: https://paste.pythondiscord.com/6EMNALDTJYK5USYSRREDMPZCEQ

delicate wren
#

hmm

#

ah, it just copied

#

!e

import numpy as np
import matplotlib.pyplot as plt
x = np.linspace(-4, 4, 100)
xp = np.linspace(-np.pi, np.pi, 10)
fp = np.sin(xp)
f = np.interp(x, xp, fp)
plt.plot(x, f)
plt.savefig('out.png')
coarse hearthBOT
vocal stream
#

Spiders have families

#

and children

#

free the spiders

#

im joking lol

dry pendant
#

How much are you paying for education materials in the last year? (learning python, university etc..)

#

from pathlib import Path
for line in Path("myfile.txt").read_text().splitlines():
if line.startswith('#'):
print(line)

#

if you already have the file read in then:

[line for line in line_array]

vocal stream
#

password_list = []
for char in range(1, nr_letters + 1):
password_list.append(random.choice(letters))

for char in range(1, nr_symbols + 1):
password_list.append(random.choice(symbols))

for char in range(1, nr_numbers + 1):
password_list.append(random.choice(numbers))

password = ""

random.shuffle(password_list)
password = ''.join(password_list)

dry pendant
# vocal stream password_list = [] for char in range(1, nr_letters + 1): password_list.appen...

Ned Batchelder
Python provides powerful primitives for iterating over your data in ways that let you express yourself clearly and directly. But even programmers familiar with the tools don't use them as fully as they could. This talk will cover Pyt

β–Ά Play video
vocal stream
dry pendant
#

"_"*5

#

"_"*len("hello")

vocal stream
distant nova
#

is it true

#

that codig

#

is the future?

sly pond
#

There will be coding in the future

#

and people code today, they also coded yesterday

#

So I guess I don't understand the question

#

the future is the future

buoyant dagger
proper ridge
#

!pypi qoin

coarse hearthBOT
#

Quantum Random Number Generator.

Released on <t:1713438701:D>.

distant nova
#

love that

amber arrow
#

hey

rough pasture
#

Hi there...

#

Anybody here?

midnight dagger
#

@still warren hello

still warren
#

Hello

#

I am muted by default

#

what is the voice chat about

#

Now i meant even if i tried to talk the app doesnt let me

#

Where ?

#

Discords gui is confusing to me

midnight dagger
still warren
#

Too much elements in the same pace

#

You are not currently eligible to use voice inside Python Discord for the following reasons:

You have sent less than 50 messages.

#

I must send 50 messages guess

#

Does that count ?

coarse hearthBOT
#

:incoming_envelope: :ok_hand: applied timeout to @still warren until <t:1721313093:f> (10 minutes) (reason: burst spam - sent 8 messages).

The <@&831776746206265384> have been alerted for review.

midnight dagger
#

In this video kaggle grandmaster Rob Mulla takes you through an economic data analysis project with python pandas. We walk through the process of pulling down the data for different economic indicators, cleaning and joining the data. Using the Fred api you can pull up to date data and compare, analyze and explore.

Copy and edit the notebook fro...

β–Ά Play video
high prairie
#

hello

hoary citrus
high prairie
hoary citrus
high prairie
hoary citrus
high prairie
hoary citrus
high prairie
#

prior to this was a js developer

#

now switching

hoary citrus
#

Okay

high prairie
#

yes

high prairie
hoary citrus
high prairie
hoary citrus
high prairie
hoary citrus
high prairie
hoary citrus
high prairie
misty sinew
#

No

#

my nickname

#

India

#

this one?

#

I watched this two times

high prairie
#

πŸ˜‚

misty sinew
#

When I drive I don't break signal, but what I do is turn left then turn right then again I turn left

high prairie
#

πŸ˜‚

#

whenever its possible

misty sinew
#

what???
80%-20%??!!!

#

oh I see, i get that

#

bro achieved everything ig

#

bro how many years of experience do you have?

#

bruhhh

#

you sound older

#

tell me how old I'm from my voice

elfin breach
midnight dagger
#

i'll go have dinner guys, ttyl

rough pasture
#

Hey guy's

misty sinew
deep niche
#

send the global one

misty sinew
deep niche
misty sinew
rough pasture
#

Hi @misty sinew

misty sinew
rough pasture
#

Are you a developer?

misty sinew
rough pasture
#

Which language are you using? Python!?

misty sinew
#

Yes I am

rough pasture
#

Okay could you guide me...I want to python...

#

So where can I start?

misty sinew
rough pasture
#

Yeah! I'm a front-end web developer...

misty sinew
rough pasture
#

Yeah that's right

deep niche
rough pasture
#

I use JavaScript for the frontend

misty sinew
misty sinew
# rough pasture I use JavaScript for the frontend

I see, if you're just planning to create APIs and this stuff.
Then start with the basics of python, once you're done then go for the database, learn the basics of SQL and database. Now when you're done picking up a web framework, meanwhile learning it learn how things work internally. You don't have to learn the whole framework at once but when you're sure you're able to build APIs for CRUD with full confidence, then go for advanced part learn async and more database concepts, meanwhile you should also explore how to deploy the backend, going through the flow you won't need a roadmap you'll learn concepts one by one by learning and exploring it, also however if your goal is still building APIs you should also build web apps that aren't consuming APIs at first but from using template engine to doing CRUD.

rough pasture
#

Okay @misty sinew thanks for this information... Appreciate it man...

hoary citrus
#

@rotund bough yeah it is working but how?

rotund bough
#

idk

distant nova
#

idk

hoary citrus
#

@distant nova ?

distant nova
#

had to go srry

hoary citrus
#

Ok

#

np

calm tusk
#

@mild flume

#

Retired wrestler Hulk Hogan ripped off his shirt to reveal a Trump-Vance tank top during his speech at the Republican National Convention, where he also praised former President Trump, calling him an "American Hero."

Β» Subscribe to NBC News: http://nbcnews.to/SubscribeToNBC
Β» Watch more NBC video: http://bit.ly/MoreNBCNews

NBC News Digital is ...

β–Ά Play video
hexed sentinel
#

..

coarse hearthBOT
#

:incoming_envelope: :ok_hand: applied timeout to @hexed sentinel until <t:1721411256:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).

The <@&831776746206265384> have been alerted for review.

split hare
#

@misty sinew I dont have ability to use voice chat yet

#

do you think you could help me with a quick python related question?

sly pond
#

@lapis matrix

lapis matrix
#

Have we considered the footwear that women typically wear in slippery winter climates? There is often less surface friction, and the quality of these shoes is usually not designed for winter activities.

#

I think it's just the curse of dimensionality it's going to take a longer Time to find the consistencies between different data points or understand which data points contribute the most towards finding a good prediction on A model That's backs up the data

sly pond
#

@crude void Hello

thin lintel
obtuse valve
#

penguin random house nice

#

it's a huge publisher

proper ridge
#

!paste

coarse hearthBOT
#
Pasting large amounts of code

If your code is too long to fit in a codeblock in Discord, you can paste your code here:
https://paste.pythondiscord.com/

After pasting your code, save it by clicking the Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.

proper ridge
#

@proud chasm

stuck bluff
#

Sue Vlaki.

sly pond
thin lintel
stuck bluff
#

A Plague Tale: Innocence is an action-adventure stealth game developed by Asobo Studio and published by Focus Home Interactive. The game was released for PlayStation 4, Windows, and Xbox One in May 2019. It was made available on the cloud-based service Amazon Luna in November 2020. The PlayStation 5 and Xbox Series X/S versions of the game were ...

#

A Plague Tale: Requiem is an action-adventure stealth video game developed by Asobo Studio and published by Focus Entertainment. The game is the sequel to A Plague Tale: Innocence (2019), and follows siblings Amicia and Hugo de Rune who must look for a cure to Hugo's blood disease in Southern France while fleeing from soldiers of the Inquisition...

pseudo raven
#

pretty regis @stuck bluff

proper ridge
midnight dagger
proper ridge
#

Send me your code.

#

!paste

coarse hearthBOT
#
Pasting large amounts of code

If your code is too long to fit in a codeblock in Discord, you can paste your code here:
https://paste.pythondiscord.com/

After pasting your code, save it by clicking the Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.

pseudo raven
#

@midnight dagger check those keys exist in the db

midnight dagger
#

all_results = []

for myid in unemp_df.index:
results = fred.get_series(myid)
results = results.to_frame(name=myid)
all_results.append(results)
unemp_df.tail(2)
pd.concat(all_results, axis=1).drop(['LNS14000150','LRUN25TTUSM156S'])

midnight dagger
pseudo raven
#

the error is telling you these dont exist 'LNS14000150','LRUN25TTUSM156S' or you're referencing them incorrectly

proper ridge
#

And any dataset you're importing.

torn canopy
#

What should I do to turn on the microphone?

torn canopy
#

thx

proper ridge
#

Pleasure!

#

I believe the issue is you're trying to drop a row but using drop column command.

#

drop usually removes columns.

#

You're trying to remove a row.

torn canopy
midnight dagger
#

how to convert it into a code thing

proper ridge
#

!code

coarse hearthBOT
#
Formatting code on Discord

Here's how to format Python code on Discord:

```py
print('Hello world!')
```

These are backticks, not quotes. Check this out if you can't find the backtick key.

For long code samples, you can use our pastebin.

pseudo raven
#

PICO CTF

proper ridge
pseudo raven
proper ridge
#

If you want to be part of the community, the requirement is not being strict by any means.

midnight dagger
#
!pip install fredapi > /dev/null
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import plotly.express as px

plt.style.use('fivethirtyeight')
pd.set_option('display.max_columns', 500)
color_pal = plt.rcParams["axes.prop_cycle"].by_key()["color"]

from fredapi import Fred

fred_key = '551bda501958d4184e31f14ded34986d'

from kaggle_secrets import UserSecretsClient
user_secrets = UserSecretsClient()
secret_value_0 = user_secrets.get_secret("fred-api")
fred = Fred(api_key=fred_key)
sp_search = fred.search('S&P', order_by='popularity')
sp500 = fred.get_series('SP500')
sp500.plot(figsize=(10, 5), title='S&P 500', lw=1)   #lw means line width
unemp_df = fred.search('Unemployment rate state', filter=('frequency','Monthly'))
unemp_df = unemp_df.query('seasonal_adjustment == "Seasonally Adjusted" and units == "Percent"')
unemp_df = unemp_df.loc[unemp_df['title'].str.contains('Unemployment Rate')]
all_results = []

for myid in unemp_df.index:
    results = fred.get_series(myid)
    results = results.to_frame(name=myid)
    all_results.append(results)
unemp_df.tail(2)
pd.concat(all_results, axis=1).drop(['LNS14000150','LRUN25TTUSM156S'])
midnight dagger
#

anyone?

proper ridge
#

One sec.

#

Talking.

pseudo raven
#

yo i gtg

#

bbl

#

peace dude

proper ridge
#

Bubye

unborn marlin
#

@tacit jetty Many companies fail, but there are tons of employed people in the industry

proper ridge
#

Check out the method for dropping rows.

midnight dagger
#

k

unborn marlin
#

@tacit jetty Break the cycle.

proper ridge
# midnight dagger k

It will help if you carefully read the documentation for pandas. It gives alot of examples.

fluid cedar
#

.

#

.

proper ridge
obtuse valve
#

this game is fun, core childhood memory

stuck bluff
#

@eternal beacon πŸ‘‹

fast path
#

hey guys, any chance I can be granted permission to share my screen?

#

I'd love to pass my knowledge to everyone who's interesting in learning python and other technologies

stuck bluff
#

Screen sharing permissions can be requested of voice-regular admin-and-above level users, ideally when they're already in the voice chat.

fast path
#

a few of us joined the code / help channel eager to learn but I'm unable to screen sharing

stuck bluff
fast path
#

it seems none on list is available yet

#

DMs ok?

stuck bluff
#

Discouraged, but nobody is able to really stop you.

fast path
#

sure, I won't do it then

#

I'll keep an eye on the server until I spot one of the admins are available

#

thanks for your help my G

stuck bluff
#

It's the weekend period, during which Mr. Hemlock is usually unavailable, and Mindful Dev, who sometimes is in on weekends has been drawn away to other duties of late.

fast path
#

got you! that makes sense

#

I'll wait

#

no big deals

#

just want point out to the fact that you look like a really good person

#

thanks ma man

#

can't thank you enough for your kindness in using your time to help me

thin night
#

Cool

terse sierra
#

todays cat video

hoary citrus
#

What happened?

terse sierra
#

heyyyyyyyyyyyyyyy there OPAL

#

micro python room based in OZ Land @stuck bluff

unreal sierra
#

@midnight dagger yo

#

ur netherlands

midnight dagger
midnight dagger
unreal sierra
#

u now what this is?

midnight dagger
#

no

hearty heath
#

Yaw

#

Yeah sorry

#

Is it Python code? @royal seal

#

Whoops, sorry for the ping

#

I meant to ping @obtuse valve

#

Oh ok

#

Yeah

#

So the beauty of Q-learning is that you don't need to look ahead. You update the Q-value of a transition each time you make that transition.

#

In practice, you learn a model for the Q-value that hopefully generalises to transitions you havent seen.

#

Online, I think. If I remember what that term means

#

Yeah, so as an RL agent, you get a reward (possibly zero) each time you make a transition.

#

Right πŸ€”

#

So, you're not training your agent in a simulation?

obtuse valve
#

s_0 -> a_0 -> state transition -> s_1

#

but idk what s_1 is, unless i make action a_0

hearty heath
#

That's true, but that's how you learn right?

#

I guess you start off with random values, and take kind of random actions.

#

Then tend towards taking actions that more-and-more exploit what you've learned.

obtuse valve
#

1000000 random simulations

  • label all "winning" ones 1.0
  • label all "losing" ones 0.0
#

like all states within the simulation

hearty heath
#

Yeah that's a different kind of thing, that's search.

#

But when you do Q-learning, you're kind of implicitly searching.

obtuse valve
hearty heath
#

It doesn't have to be a table.

#

Yeah

#

So, I think the term you're looking for is temporal difference learning possible?

#

I'm not current on ML techniques though (like, I literally did this stuff ten years ago before the current AI boom lemon_sweat).

#

Errrr lemon_sweat let me do some reading

#

Do you have a university library? I recommend getting your hands on a copy of AIMA if you can. The chapters on MDPs and RL are pretty good and clearly written.

obtuse valve
#

lol no

#

im starting a levels this september lmao

hearty heath
#

Oh right ok

obtuse valve
#

also just curious

#

do you like wallace and gromit

hearty heath
#

It's alright πŸ˜„

obtuse valve
#

your pfp πŸ‘€

#

it's smth from aardman studios

#

i can recognise it

#

machiavellian penguin

#

i forogt his name

#

massive baddie

hearty heath
#

Yeah, it's Feathers McGraw πŸ˜„

#

from the wrong trousers

#

They're releasing a sequel later this year I think

obtuse valve
#

hmm

obtuse valve
#

also i cant talk as well rn

#

im downstairs again

hearty heath
#

Oh ok

obtuse valve
#

bc of shit wifi in the attic

#

so how does it work in q learning (dont mind the td learning)

#

i will get shit sorted hopefully

#

interesting shit

#

i heard of dqn before

#

PERFECT

#

another mujoco sim

#

and tutorial from pyotrch???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????/////////////

#

OMG

#

yk dqn? it was "novel" about 10 years ago

hearty heath
#

Hey @pine jacinth πŸ‘‹

#

Sorry we're both muted right now πŸ˜„

#

Not very exciting.

obtuse valve
#

yeah, just RL stuff

hearty heath
obtuse valve
#

hm

hearty heath
#

Brb while I do some reading

obtuse valve
#

it's just "deep q learning"

#

aight

hearty heath
#

Deep q-learning I assume is just q-learning using deep neural nets

obtuse valve
#

yes

#

q learning sounds a lil fucked imho, i STILL think that i need to sort of "simulate" the next state

#

or somehow have the agent to "learn" the environemtn

#

and the state transition function

pine jacinth
obtuse valve
#

yk any RL algs that learn the state transition function itself?

#

that could be VERY powerful

#

or even better, learn the env

#

muzero is what im thinking of

#

iirc DQN was a big deal in 2012

#

like it played atari games from what ive read

hearty heath
#

Nice quote from AIMA:

[...] Reinforcement learning differs from "just solving an MDP" because the agent is not given the MDP as a problem to solve; the agent is in the MDP. It may not know the transition model or the reward function, and it has to act in order to learn more. Imagine playing a new game whose rules you don't know; after a hundred or so moves, the referee tells you "You lose". That is reinforcement learning in a nutshell. [...]

obtuse valve
#

yeah sounds very convenient

#

that sounds great man

#

like imagine monopoly

hearty heath
#

With monopoly, you could go with a model-based approach, because you already know the rules of the game.

obtuse valve
#

iirc some ai has learnt driving on gta

#

like it was wild

#

like the nn was outputting like frames of driving etc

#

fucked up

#

i couldnt find it

hazy minnow
#

v

hearty heath
#
obtuse valve
#

was about to say

#

was it him or was it yannic kilcher

#

but yeah ik sentdex made a series on it

#

goated rich boi that gets sponsored all the time

#

but he's quite knowledgeable

hearty heath
#

Ok, so there's "passive reinforcement learning" where the policy of the agent is fixed and you're learning the utilities of the states under that policy. And there's "active reinforcement learning" where the agent is simultaneously trying to figure out a policy.

obtuse valve
#

perfect timing

#

i still dont't understand utility

#

like u value

#

like it's obv in alphazero

#

(ish)

obtuse valve
#

(sorry im presently distracted by my alphazero run)

#

alright back

hearty heath
obtuse valve
#

😡

#

ive seen this fucking diagram fo so many times

hearty heath
#

So this would be the utilities you get by just "solving the MDP"; it's the utilities of the states under the optimal policy:

obtuse valve
#

i feel stupid seeing this

#

why do i even need this when i have q values

hearty heath
obtuse valve
#

it tells me the expected return, which is the cumulative rewards, of an action in a specific state?

obtuse valve
#

not this particular example but yeah

royal rivet
#

hello

hearty heath
hearty heath
obtuse valve
#

the u value sounds sus

#

like what else can it tell me that i would find useful that isnt alr described by

  • policy
  • value
  • action value (q)
#

fuck all it seems

hearty heath
# obtuse valve that's the q value right

Q-value is the same thing, but for a state and a tentative action, whereas the u-value/v-value/utility is the maximum over all possible actions you could take from that state.

obtuse valve
#

wot???

#

so max(Q(s,a))????????

hearty heath
#

U(s) = max(Q(s, a) for a in actions)

obtuse valve
#

but isn't that a*?

#

like optimum action

obtuse valve
#

ok so it's "value" but for q

#

very fucking interesting

#

since "value" is technically the expected return of a state following pi

royal rivet
#

Do you know python language?

obtuse valve
#

as in, the best actions taken from pi directly from the state, as opposed to q where its goal is to measure the "action value" specifically

obtuse valve
obtuse valve
#

like that sounds so fucking complete now

#

rl is now full circle

#

i get a function/cool abstraction for every little thing

royal rivet
#

where are you from?

obtuse valve
#

instead of max(Q(s,a) for a in actions) ❌:
U(s) βœ…

#

genius

#

we RL bros are so excessive and i like it :D

#

ty for clarifying though :p

#

im happy

hearty heath
# obtuse valve but isn't that a*?

Yes, I'm talking about the value of the state under the optimum policy. I think under a particular policy Ο€(s): U(s) = Q(s, Ο€(s)) (assuming your policy is deterministic and not random)

#

It's a bit harder going the other way (getting the Q-value from the U-value) because you need a transition model.

#

brb

obtuse valve
#

ok so in theory, with perfect V*:

a* = argmax(pi*(s))
Q(s,a*) = U(s)
obtuse valve
#

shit backticks no work

obtuse valve
#

which is, iirc:
A(s,a) = Q(s,a) - V(s)

royal rivet
#

see you soon

obtuse valve
#

you can do:

u_val = U(s)
a_star = None
q_vals = {}
for a in actions:
    if u_val == Q(s,a):
      a_star = a
    advantage = A(s,a)
    q_vals[(s,a)] = advantage

idk im thinking on top of my head

hearty heath
#

Btw, u-value and v-value and "utility" are the same thing. Different books use different terminology. Just in case that wasn't clear.

obtuse valve
#

well they are a bit nuanced

#

like the exact thing that they are measuring arent exactly the same

#

is it

#

eg they use distinctly different formulae

hearty heath
#

No I think they're the same thing generally:

In this chapter we use U for the utility function [...] but many works about MDPs use V (for value) instead.

hearty heath
obtuse valve
#

interesting

#

they describe the nn as a "q network"

#

i wonder if nns output values or q values

#

since in alphazero they output values

#

and more speficially, values that are clipped from -1 to 1

#

using softmax

#

@hearty heath this is what i think i dont get

#

i see some subtraction in a ()^2, ig somehting to do with mse???

obtuse valve
hearty heath
#

Yeah

obtuse valve
#

hmm expected value of some mse? sussy baka

#

idk how that works, like i thought expected values = p_1 * w_1 + p_2*w_2 ...

hearty heath
obtuse valve
#

i can probs write this out in ~3 lines of pytorch code

#

basically backprop

hearty heath
#

So like Q(s, a; theta) is your neural net or whatever, with parameters theta, and its meant to approximate Q*(s, a).

obtuse valve
#

loss = MSELoss()
for i in dataset:
    q_i = model(i)
    loss(preds_i - q_i)
    loss.backward()
    model.zero_grad()
    optim.step()

or something

#

restarted stream

#

and iirc the optim is sgd

hearty heath
#

In the reinforcement learning community this is typically a linear function approximator...
I guess this is not the case anymore πŸ˜„

obtuse valve
obtuse valve
#

like hmm what's the best y=mx+c for this game πŸ€”

hearty heath
obtuse valve
hearty heath
#

Like where you hand-craft the features.

obtuse valve
#

yeah ik handcrafted stuff

#

still very much alive in the chess community

#

even though there are nnues

#

which are basically cpu nn

#

but it can incrementally update the outputs

#

which makes it viable on cpu

#

anyways

obtuse valve
#

so this nn outputs "state action values" and not "state values"

#

i shouldve seen it coming

#

"Q-Network"

#

🀦

hearty heath
#

Β―_(ツ)_/Β―

obtuse valve
#

like the one that says "differentiating..."

#

is this just regular backprop

#

ive read it a few times

#

like dL/dy right

#

or more precisely, the gradients of each weight i in nn theta

hearty heath
#

Yeah I think so. I'm still wrapping my head around the notation actually. I don't understand what a subscript on an expectation is supposed to denote.

obtuse valve
#

i think it's a shit way of saying "given", ik it's weird

#

im still guessing

#

like E[...|s=s, a=a...]

#

that's the only logical shit

#

ugh dinner is late tonight

#

so i might have dinner in ~10 mins

#

fuck

#

right in the middle of a focus sesh

hearty heath
obtuse valve
#

i mean that's my guess at least

#

also

#

yk the difference between td learning and q learning

#

what are you reading on then

#

hmm it seems that DQN works less well on determinsitic envs

hearty heath
#

There's such thing as TD Q-learning.

#

I'm just writing some python code that I hope illustrates the idea of TD learning.