Feeling guilt over postpartum depression

After I had my second child 4 months ago I developed postpartum depression. I also have a 2 year old and I just found it really hard and I felt sad all the time. I would get stressed out and angry over nothing. Most days I would cry and shout at my kids all the time. I used to dread the day and didn’t really play with my toddler because I was abit ocd with the housework! I even smacked my little girl a few times (not hard). I went to the doctor and got medication and I’m a lot better now. I enjoy the day and I’m always playing with the girls and making them laugh and taking them out. I just feel so guilty that I was horrible for the first few months of my babies life 😢 I feel guilty for shouting at them. I don’t do it anymore. I’m a lot calmer. I feel like a terrible mother :-(