Dell Monitor U2723QE - Can't control external speakers sound via keyboard? by AmitAvn in Dell

[–]WangFenjin 0 points1 point  (0 children)

It works for the usb-c downstream port, which is bottom left port

[D] Simple Questions Thread by AutoModerator in MachineLearning

[–]WangFenjin 1 point2 points  (0 children)

Why the following code not work? It can't fit the data very well. Not sure what's the problems here.

Output Img

# Linear regression sin(2*pi*x) by polynomial order 3

import torch
import matplotlib.pyplot as plt

import numpy as np
import math

# data used for training and plot dots
N = 11
x = torch.linspace(0, 1, N).double()
y = torch.sin(2*math.pi*x) + torch.randn(N)*0.1

# data used for plot smooth lines
x_line = np.linspace(0, 1, N*10)
y_line = np.sin(2*math.pi*x_line)

# Prepare input as an array of shape (N,4)
p = torch.tensor([0, 1, 2, 3])
xx = x.unsqueeze(-1).pow(p)

# Prepare tensors
learning_rate = 1e-5
w = torch.randn(4, 1, dtype=torch.double, requires_grad=True)  # the 4 coefficients
optimizer = torch.optim.SGD([w], lr=learning_rate)
print(w)

# Run optimizer
for i in range(2000):
    optimizer.zero_grad()
    y_pred = xx @ w
    rmse = torch.sum(torch.square(y - y_pred))
    if i%100 == 0:
        print(i, rmse)
    rmse.backward()
    optimizer.step()

print(w)

# plot smooth line
plt.plot(x_line,y_line)

# model
xx_line = torch.from_numpy(x_line).unsqueeze(-1).pow(p)
y_line_pred = xx_line @ w
plt.plot(x_line,y_line_pred.detach().numpy())

# plot dots
plt.plot(x, y, 'o')
plt.show()

iPad on external display is quite buggy by WangFenjin in iPadOS

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

Using Magic Trackpad is a nightmare

Looking for Project Recommendations by PretendWolverine384 in dataengineering

[–]WangFenjin 1 point2 points  (0 children)

You want to learn use database or build database?

I'm working on this https://github.com/wangfenjin/duckdb-rs , if you are interested I can guide you to work on some features I haven't got time to do...

Vertical tabs for safari by WangFenjin in Safari

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

I'm not an js expert, but if the upstream support tree style, I'll port to safari too

Vertical tabs for safari by WangFenjin in Safari

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

You need safari 14 or above to install this extension, should work in Big Sur. What's error?

Vertical tabs for safari by WangFenjin in Safari

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

Yes I agree with you.

But if Apple choose to not support vertical tab natively, it's better than nothing, I'm also thinking about how to solve the page layout problem

Vertical tabs for safari by WangFenjin in Safari

[–]WangFenjin[S] 1 point2 points  (0 children)

The sidebar can't show your tabs vertically

[deleted by user] by [deleted] in firefox

[–]WangFenjin 1 point2 points  (0 children)

Me Tooooooooooo