It will have to be a mighty powerful fence that will require a hefty power source to keep it running through the night. Unless you can get a shock collar on all the bears and cougars in the area, like dogs. You best bet for keeping yourself safe from bears and cougars is to tie what's called a "bear bag" a little ways away from your campsite. String it up between two trees and put all of your "smellables" in it. This includes food, garbage, toothpaste, soap, body sprays etc. This should keep you relativly safe from the bears.