Thank you very much! While I do not express my idea completely, so I draw a graph, like this:

graph.png1287×788 19.8 KB

I input x and get y_pred, the parameters are W and b.

tt.png994×494 41.1 KB

I think the graph could not express the idea. But I hope you could understand my idea.
Should I write a special class like Linear for this?