Doesn't add any features or applicability, but cuts out ~100 lines of code. But as I work with the library a lot, I really appreciate less to navigate through. As a slight bonus, it makes type compatibility clearer as we slowly add annotations.
An IdentityLibrary is just a degree 1 PolynomialLibrary with no bias term.
This should just call super().__init__() with the proper terms (degree, etc). Then the class should be moved to optimizers/base.py
Or it can simply become a factory function for calling PoynomialLibrary with the correct arguments. It seems like the main factor is type safety. Would love to have this discussion if anyone's interested, but I don't trust myself to think it through properly if I'm just discussing it with myself.
Doesn't add any features or applicability, but cuts out ~100 lines of code. But as I work with the library a lot, I really appreciate less to navigate through. As a slight bonus, it makes type compatibility clearer as we slowly add annotations.
An
IdentityLibrary
is just a degree 1PolynomialLibrary
with no bias term.This should just call
super().__init__()
with the proper terms (degree
, etc). Then the class should be moved to optimizers/base.pyOr it can simply become a factory function for calling
PoynomialLibrary
with the correct arguments. It seems like the main factor is type safety. Would love to have this discussion if anyone's interested, but I don't trust myself to think it through properly if I'm just discussing it with myself.