The utility of classical neural networks as universal approximators suggests that their quantum analogues could play an important role in quantum generalizations of machine-learning methods. Inspired by the proposal in Torrontegui and Garcia-Ripoll [Europhys. Lett. 125, 30004 (2019)], we demonstrate a superconducting qubit implementation of a controlled gate, which generalizes the action of a classical perceptron as the basic building block of a quantum neural network. In a two-qubit setup we show full control over the steepness of the perceptron activation function, the input weight and the bias by tuning the gate length, the coupling between the qubits, and the frequency of the applied drive, respectively. In its general form, the gate re...