Im sorry to hear this sometimes agression that is very out of character can be a sign of illness or that the dog is in pain I would probably have the dog given the once over at the vets, my dog recently was very out of character recently being grumbly and growling at my DH we took him to the vets for a once over and he was very good and checked everything we had noticed he had been rubbing his ear alot and it was when DH fussed his face that he growled it turns out he had ruptured his ear drum, it has all healed up now and he is back to his normal self!
I know it must have shaken you all up so much and it may be that re-homing is the only option but alot of people don't realise that such a change of character is usually a sign that all is not right with the dog and worth getting ruled out they are so good at hidding pain sometimes that this character change can be the only sign there is anything wrong.
Nicola G I am sure you re-homed your dogs for the right reasons for your family, you are however ment to supervise dogs with babies 24/7 which yes is not and easy thing to do and if you are not able to do so it is best to re-home the dog but no if you go to the toilet the dog and baby should not be left alone together the dog should be put in another room all it can take is for a small child to pull a dogs tail very hard or hurt/startle them in some other way and the dog can't really be blamed for biting.