Children and machines think a lot alike