I read some years ago about a self tuning piano. Each string had a miniature heater attached and and the temerature was adjusted to expand or contract the string to maintain perfect pitch. I can't visualise devising a similar "gizmo" small enough for a guitar.