Comments (4)
Yes, that's in scope and it seems straightforward.
I'm curious, what are you building that requires all these niche linalg ops?
from keras.
I've investigated this, and it's actually impossible to achieve consistency across backends for the resid
and s
return values (the solutions x
, the first returned value, is fine). Even jax.numpy
isn't consistent with numpy
. Torch does it differently from both as well (despite having the same API).
We could make the function only return x
. Are the other values ever useful?
Looking at code in the wild I could only find samples that used x
. Other values area apparently always discarded. It's a pretty weird API tbh.
from keras.
yeah I think it makes sense to only return x
, and I can imagine very few use-cases where the caller would really care about the other outputs. It might be helpful to return None
for the other 3 outputs of the numpy interface just so it's a drop-in replacement for JAX. The other upside to having placeholder None
outputs is that it avoids a potential footgun in case someone happens to be solving for an x
with x.shape[0] == 4
, as if they call lstsq
with 4 output slots it will silently unstack the tensor along the first dimension which is definitely not what the caller would want.
from keras.
For reference, TensorFlow's tf.linalg.lstsq
only returns x
https://www.tensorflow.org/api_docs/python/tf/linalg/lstsq (though it also has a different signature).
I added the API, only returning x
. Returning None
entries would be problematic since ops are only ever supposed to return tensors.
from keras.
Related Issues (20)
- averagePooling2D calculates wrongly with torch backend HOT 1
- softmax sliently generate a wrong output when the mask has an incompatible shape HOT 1
- CenterCrop meets a division-by-zero with jax backend HOT 2
- CategoryEncoding generate output with wrong shape when output_mode='one_hot' and the last dim is 1 HOT 1
- Resizing layer meets division by zero crash with jax backend HOT 2
- Multi-process batch size not calculated correctly HOT 6
- Overriding `Layer.forward` unexpectedly changes the signature of `Layer.__call__` under torch backend HOT 5
- The .fit() method passes unsized batches to a custom loss function. HOT 3
- Bidirectional layer rejects custom activations HOT 4
- Has any plan for int4? HOT 1
- Unexpected Losses with Sample Weights HOT 1
- ModuleNotFoundError: No module named 'keras.utils.generic_utils' HOT 1
- I wrote a custom layer like this and i am not confident of serializing this layer finally, how to write this in best way? HOT 2
- "Keras.wrappers" <module not found error> in 'python IDLE 3.12.0' HOT 4
- Custom Generator crash for variable input dimensions HOT 4
- Add `on_epoch_begin` to `utils.Sequence` HOT 1
- Conv3D generates output on Tensorflow backend while crashes on pytorch backend HOT 2
- RNN layer: len is not well defined for a symbolic Tensor. Please call `x.shape` rather than `len(x)` for shape information. HOT 3
- keras.ops.select doesn't accept tuples as input HOT 1
- Recommendation for writing tests for ModelParallel distribution HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from keras.