Add class method #from_weights