Transfer learning implementation in python