He goes from 'oh my god, what have I done' to 'yes master I will do anything you say to protect Padme' to 'agree all the Jedi must die' to 'everyone is against me, including my wife and best friend'. There just doesn't seem to be any explanation other than he has completely in a second just flipped on a dime about everything he believes in and thinks!
At that point, when Anakin watches PalpSidious electrify Mace right out of the window, he realizes that he screwed himself. Anakin knew he could never go back to the Jedi temple without them sensing his betrayal so he attacks the Jedi out of fear of their retaliation. Anakin's original plan for turning to the dark side was to learn the secret of how to save Padme but as time went on, the dark side corrupted his mind to the point where he's more concerned about being the most powerful being in the galaxy. When Anakin sees Obi-wan standing inside Padme's ship, he knew that Obi-wan has come to kill him for what he did to the jedi but the worst part is Anakin allowed the dark side to warp his mind into believing that Padme brought Obi-wan to kill him. Anakin didn't bother to read Padme's thoughts to see she had no idea that Obi-wan was onboard her ship so he chokes her instead and proceeds to fight Obi-wan.
Anakin's turn to the dark side didn't come out of nowhere because it has been progressing since the day he left his mother on Tatooine and lost Qui-Gon Jinn at the same time. He had attachment issues since then and the Jedi did nothing to help him deal with these issues. It also didn't help that Anakin had PalpSidious screwing with his mind for years with false praises and fake criticism against the Jedi but what really put Anakin on the dark path is watching his mother die in his arms and having Ahsoka abandon him. His dreams of Padme dying in childbirth were the final nail in the coffin because Anakin will do whatever it takes to save her even if it meant joining forces with a Sith lord.