kumatheworld / fakeglyph

Fancy brand new letters with generative models
MIT License
0 stars 0 forks source link

Unify View and Interpolate in fakeglyph/model/units.py #5

Closed kumatheworld closed 1 year ago

kumatheworld commented 1 year ago

You can define a module that looks something like the following.

class FunctionalModule(nn.Module):
    def __init__(self, func: Callable) -> None:
        super().__init__()
        self.forward = func

Then View and Interpolate can be made class methods rather than separate classes. It will be nice to support type hints and override __repr__() to describe the function clearly.