  High-order wave-making theories are becoming available but are limited to
certain ranges of waves and wavemaker types in their applicability.
Alternatively, machine learning can be considered to find nonlinear functional
relationships. Therefore, this paper proposes a simple and universal framework
for generating and absorbing waves based on machine learning. This framework
trains neural networks to establish the transfer function between the
free-surface elevation on the wavemaker and the wavemaker velocity.
Significantly, penalty term and data augmentation techniques based on
wave-making mechanisms are introduced to increase the generalization ability of
neural networks, rather than pure data-driven. Therefore, once the target wave
profiles in front of the wavemaker are given, it can realize generating waves
and absorbing reflected waves at the same time. Taking piston and plunger
wavemakers as examples, an in-house numerical solver is applied to simulate
both wave generation and absorption. The simulated wave profiles and wave
orbital velocities are validated with analytical solutions, showing that the
proposed framework is effective at eliminating the re-reflection wave. Then,
the validation for generating the solitary wave and the New-year wave is
performed, indicating that the generated waves agree quite well with the
desired wave elevation. The proposed framework can facilitate the wavemaker
design in the future, and no complex theoretical derivation is required.
