Stream processing of data is nicer using a declarative approach. Though I've found that describing control flow is often more intuitive using an imperative approach. It's a shame that redux-saga got tied to react/redux, because the idea of generators and declarative effects are universal - useful on both backend and frontend.
Edit: Great work! I'd love to have a nice alternative to PyTorch in JavaScript :)
Edit: formatting
Making JavaScript look like Python in this case could potentially bite you in the ass.
From the example:
const torch = require("js-pytorch");
// Instantiate Tensors:
x = torch.randn([8,4,5]);
w = torch.randn([8,5,4], requires_grad = true);
b = torch.tensor([0.2, 0.5, 0.1, 0.0], requires_grad = true);
And:
class Transformer extends nn.Module {
constructor(vocab_size, hidden_size, n_timesteps, n_heads, p) {
//.....
this.b1 = new nn.Block(hidden_size, hidden_size, n_heads, n_timesteps, dropout_p=p);
For both `requires_grad` and `dropout_p` you wouldn't be able to change the ordering + you're creating global variables.
/**
* All of the arguments for this function are positional
* and cannot be provided in a different order than defined
*/
function performOperation(values, arg1 = false, arg2 = -1) {
//....
}
/**
* This works, but only because of the order
*/
const result = performOperation([1, 2, 3], arg1 = true, arg2 = 10);
/**
* This does not work
*/
const result = performOperation([1, 2, 3], arg2 = 10, arg1 = true);
/**
\* What is actually happening
\*/
arg1 = true; // global variable
arg2 = 10; // global variable
const result = performOperation([1, 2, 3], 10, true);
Thats true, it’s a limitation of working between these languages. I tried to mitigate it by using clear JSDoc, so that each variable pops up alongside an explanation when calling a function.
I feel you - Python has much better (more flexible) argument support than JavaScript in this case. Converting the entire set of arguments into a keyed object is usually what happens, but then it wouldn't look like PyTorch anymore.
I had the exact same issue and spent a lot of time figuring out why this was a problem for me, as I would alter between my old 15 inch and new 16 inch and feel the difference each time.
Long story short, I found a solution that removed all my issues;
- Use the accessibility «contrast» feature set to level 2
- Use an app[0] that applies a gamme filter to adjust the white level down to account for the contrast increase
- (optional) use an srgb color profile that disables temporal dithering of colors
This reduces you max brightness level to the same amount as the old 15 inch (I don’t need the extra brightness) but allowes you to keep the backlight at max output, minimizing the pvm strobing effect[0] that some people seem to be sensitive to.
Just saw this - I had played with numerous settings for a long time and some seemed to make it better, some not so. I did not try your solution.
BTW, I don't run into any issues with the 13" M1 AIR also. So, decided that it wasn't worth it for me to have to fiddle around with setting on a rather expensive piece of hardware and decided to return it and wait in case Apple launches a 15" MB Air with a regular (as in not mini LED) screen.
In they don't, I'll give the 16" MBP another shot and might try your solution.
CRT monitors made things look so much more vivid than on LCD. So when you look at old games today and think «Did it really look this bad and pixelated?», the answer is actually «no».
Another lefty here - same issue. Did the pre-order long ago. I’m back to pen and paper as I could not tolerate it. It would be great if it was possible to calibrate it somehow, by hack or not. I’ve kept it in case such a solution surfaces.
I definitely think they should be petitioned for a left-handed mode.
Edit: it has left handed mode?! Perhaps I've already set that, but it isn't thorough enough? Gonna go check now. Btw, it's under settings, accessibility.
That might not all be attributed to nostalgia. CRT displays actually make things look more hi-res and «depthy» [0]. We’ve barely caught up with 4/8K and OLED. This is why CRTs are so popular for retro gaming. Some effects aren’t even possible to display correctly on a non-CRT (without shaders at least) [1].