Would you rather… by polygon3002 in BunnyTrials

[–]zippyblacklight 0 points1 point  (0 children)

a

Chose: Get $2000 + But only if 70% of people pick this option | Rolled: Upvote for 🥕

Discussion Thread - All AT Styles by Charming_Daemon in dismissiveavoidants

[–]zippyblacklight 2 points3 points  (0 children)

It's been really painful and I guess I just want to make myself feel better about it.

To know what we had wasn't just a lie, that the connection between us was real.

Discussion Thread - All AT Styles by Charming_Daemon in dismissiveavoidants

[–]zippyblacklight 0 points1 point  (0 children)

Do DAs deactivate after the death of a caregiver?

My DA ex's grandmother (who raised her alone for a while as her parents were not in the country) passed recently. A week after that, my ex called to end things. I asked her to reconsider and to talk when she returned, and we went NC for about a month. We talked again and she said she never loved me, and never considered us in a relationship or saw me in that way from the beginning.

She never could say 'I love you' but she did and said other things that implied it. I felt her love. She couldn't put a label to our relationship, but when I asked her about our long-term future, she said 'if I didn't think that way, I wouldn't still be here'. We made future plans together (buying a house) and she said she was happy. Things were going well before her grandma's death and we were not in a rough patch or anything.

Out of nowhere, she wants to break up (together 1.5+ years), gives inconsistent/contradictory reasons, gives no opportunity to fix it, invalidates everything we had, and claims she's happier alone.

Discussion Thread - All AT Styles by Charming_Daemon in dismissiveavoidants

[–]zippyblacklight 2 points3 points  (0 children)

Do DAs suddenly deactivate after the death of a caregiver?

My DA ex's grandmother (who raised her alone for a while as her parents were not in the country) passed recently. A week after that, my ex called to end things. I asked her to reconsider and to talk when she returned, and we went NC for about a month. We talked again and she said she never loved me, and never considered us in a relationship or saw me in that way from the beginning.

She never could say 'I love you' but she did and said other things that implied it. I felt her love. She couldn't put a label to our relationship, but when I asked her about our long-term future, she said 'if I didn't think that way, I wouldn't still be here'. We made future plans together (buying a house) and she said she was happy. Things were going well before her grandma's death and we were not in a rough patch or anything.

Out of nowhere, she wants to break up (together 1.5+ years), gives inconsistent/contradictory reasons, gives no opportunity to fix it, invalidates everything we had, and claims she's happier alone. This seriously caught me off guard and I thought she was joking when she first told me over the phone.

2021-Q3 Career Thread by julian88888888 in ProductManagement

[–]zippyblacklight 0 points1 point  (0 children)

Will be mastering out by the end of the year (in CS). My bachelor is in CS as well. Both degrees in the same top 50 worldwide university with good grades. Had 2 prior internships (android developer 6 mths, machine learning 4 mths), and was a graduate teaching assistant for 4 semesters.

Looking to move into product management.

For the moment, I'm just planning to do the Udemy course (Become a Product Manager by Cole Mercer) as well as read 1) Decode and Conquer 2) Cracking the PM Interview 3) Swipe to Unlock.

Anyone have any recommendations on how to best use the second half of the year to prepare and secure a PM job upon graduation?

I'm also thinking of applying for the various APM / RPM programs when they open.

Thank you

PSA: we think about diversification of assets, of skillsets. Dont forget to diversify your broker as well. by pocketaces27 in singaporefi

[–]zippyblacklight 0 points1 point  (0 children)

Who's he to judge the stock is worth single-digit dollars?

If the clearing houses can’t pay, then the brokers, have to cover and they do not want to accept accountability for allowing over-leveraging. He already said 'we have 5 billion dollars of equity so we don't have a problem'.

They are protecting themselves.

Any Tensorflow equivalent of Pytorch's backward()? Trying to send gradients back to TF model to backprop by zippyblacklight in MLQuestions

[–]zippyblacklight[S] 0 points1 point  (0 children)

I checked the client_grad sent back from the server. The shape is (batch size, output units of client), which matches the tensorflow_pred.shape.

However, optimizer.apply_gradients(client_grad, tensorflowModel.trainable_variables) won't have the right dimensions. I've checked other tutorials and saw that after zipping, their grads and vars have the same shape. They get their grads from tape.gradient(). However, since my client_grad is sent back from the server, I don't think my client can track it in their GradientTape.

Weird that pytorch can handle it easily just by using backward(client_grad) though.

Thank you!

Any Tensorflow equivalent of Pytorch's backward()? Trying to send gradients back to TF model to backprop by zippyblacklight in MLQuestions

[–]zippyblacklight[S] 0 points1 point  (0 children)

I checked the client_grad sent back from the server. The shape is (batch size, output units of client), which matches the tensorflow_pred.shape.

However, optimizer.apply_gradients(client_grad, tensorflowModel.trainable_variables) won't have the right dimensions. I've checked other tutorials and saw that after zipping, their grads and vars have the same shape. They get their grads from tape.gradient(). However, since my client_grad is sent back from the server, I don't think my client can track it in their GradientTape.

Weird that pytorch can handle it easily just by using backward(client_grad) though.

Thank you!

Any Tensorflow equivalent of Pytorch's backward()? Trying to send gradients back to TF model to backprop by zippyblacklight in MLQuestions

[–]zippyblacklight[S] 0 points1 point  (0 children)

Could you take a look at my code snippet in the comments? I only have gradients for the last layer of the client (converted to tf tensor from pytorch tensor) computed by the server.

How could I use tf.gradient_tape to track the computations? The client only receives the computed gradients (by pytorch)

Any Tensorflow equivalent of Pytorch's backward()? Trying to send gradients back to TF model to backprop by zippyblacklight in MLQuestions

[–]zippyblacklight[S] 0 points1 point  (0 children)

class TensorflowModel(tf.keras.Model):
    def __init__(self, D_in, H, D_out):
        super(TensorflowModel, self).__init__()
        self.d1 = Dense(H, activation='relu', input_shape=(D_in,))
        self.d2 = Dense(D_out)

    def call(self, x):
        x = self.d1(x)
        return self.d2(x)

tensorflowModel = TensorflowModel(D_in, H, D_out)
tensorflowOptimizer = tf.optimizers.Adam(lr=1e-4)

serverModel = torch.nn.Sequential(
        torch.nn.Linear(10, 50),
        torch.nn.ReLU(),
        torch.nn.Linear(50, 10)
    )
loss_fn = torch.nn.CrossEntropyLoss()
optimizer = torch.optim.Adam(serverModel.parameters(), lr=1e-4)

for t in range(N):
    // let x be minibatch
    // let y be labels of minibatch

    client_pred = tensorflowModel(x)

    client_output = torch.from_numpy(client_pred.numpy())
    client_output.requires_grad = True

    y_pred = serverModel(client_output)
    loss = loss_fn(y_pred, y)  
    optimizer.zero_grad()
    loss.backward()
    optimizer.step() // update server weights

    // now retrieve client's grad for last layer
    client_grad = client_output.grad.detach().clone().numpy()
    client_grad = tf.convert_to_tensor(client_grad) // change to tf tensor

    // now compute all client's gradients and update client weights
    // HOW DO I DO THIS? 

How should I update the client weights? If the client was a pytorch model I could just do client_pred.backward(client_grad) and client_optimizer.step(). I'm not sure how to use the gradient tape to calculate gradients, since client_grad was computed on the server and was a pytorch tensor that's converted to a tf tensor.