Recent studies have shown that the aggregated dynamic flexibility of anensemble of thermostatic loads can be modeled in the form of a virtual battery.The existing methods for computing the virtual battery parameters require theknowledge of the first-principle models and parameter values of the loads inthe ensemble. In real-world applications, however, it is likely that the onlyavailable information are end-use measurements such as power consumption, roomtemperature, device on/off status, etc., while very little about the individualload models and parameters are known. We propose a transfer learning based deepnetwork framework for calculating virtual battery state of a given ensemble offlexible thermostatic loads, from the available end-use measurements. Thisproposed framework extracts first order virtual battery model parameters forthe given ensemble. We illustrate the effectiveness of this novel framework ondifferent ensembles of ACs and WHs.