What philosophies were the samurai influenced by