Keira Knightley's decision to sleep train her daughter while filming the political thriller "Official Secrets" gave her performance an edginess, but isn't a technique she'd recommend to fellow actors.

Knightley says transitioning her 3-year-old daughter from a baby bed to a traditional one left her a bit frayed, so she used it to portray Iraq War whistle-blower Katharine Gun. Gun was convicted of violating Britain's Official Secrets Act after leaking a confidential memo that showed governments in the United States and the United Kingdom were spying on countries wavering in their support for the war.

The actress joked that the sleep training at her home made it "quite tricky" to remember her lines.

Knightley says she wanted to make sure she accurately depicted Gun's actions.

"Official Secrets" open in the U.S. on Aug. 30 and in the U.K. in October.