I went through the same problem with Jaxon and the puppy class. Most of the other dogs were retrievers, shelties or other larger breeds. He was very overwhelmed and often quite scared. I left his bag on the ground so he could 'retreat' whenever he felt it was needed. When they had the playtime off the leash, I would let him try it out but pick him up when the other dogs were getting rough. They don't understand how small the Yorkies are! I am surprised the trainer yelled at you for picking up your baby. I mainly attended these classes for socialization and to pick up a bit of training information.
I agree with asking the trainer about controlling the other dogs and seeing if you could delay starting the classes. You should also look into the meet up groups (
www.meetup.com) and see if there is a Yorkie group near you. Jaxon was just over 3 months old when we started the puppy classes - he's now 6 months and slowly getting better about being social with other people and dogs. Before he always crouched low to the ground. We are starting obedience classes this week and hopefully he'll be more comfortable. Hope it works out for you.