#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# @title          :probabilistic/prob_mnist/train_split_ewc.py
# @author         :ch
# @contact        :[email protected]
# @created        :01/10/2021
# @version        :1.0
# @python_version :3.8.5
"""
SplitMNIST with EWC
-------------------

This script is used to run EWC experiments on SplitMNIST.
"""
# Do not delete the following import for all executable scripts!
import __init__  # pylint: disable=unused-import

from probabilistic import ewc_args
from probabilistic import ewc_utils

if __name__ == '__main__':
    config = ewc_args.parse_cmd_arguments(mode='split_mnist_ewc')

    ewc_utils.run(config, experiment='split_mnist_ewc')
# A function handle, that is used to evaluate the performance of a run.
_PERFORMANCE_EVAL_HANDLE = hpsplit._performance_criteria

# A key that must appear in the `_SUMMARY_KEYWORDS` list. If `None`, the first
# entry in this list will be selected.
# The CSV file will be sorted based on this keyword. See also attribute
# `_PERFORMANCE_SORT_ASC`.
_PERFORMANCE_KEY = 'acc_avg_final'
assert (_PERFORMANCE_KEY is None or _PERFORMANCE_KEY in _SUMMARY_KEYWORDS)
# Whether the CSV should be sorted ascending or descending based on the
# `_PERFORMANCE_KEY`.
_PERFORMANCE_SORT_ASC = False

# FIXME: This attribute will vanish in future releases.
# This attribute is only required by the `hpsearch_postprocessing` script.
# A function handle to the argument parser function used by the simulation
# script. The function handle should expect the list of command line options
# as only parameter.
# Example:
# >>> from probabilistic.prob_mnist import train_args as targs
# >>> f = lambda argv : targs.parse_cmd_arguments(mode='split_mnist_bbb',
# ...                                             argv=argv)
# >>> _ARGPARSE_HANDLE = f
import probabilistic.ewc_args as targs
_ARGPARSE_HANDLE = lambda argv : targs.parse_cmd_arguments( \
    mode='cifar_resnet_ewc', argv=argv)

if __name__ == '__main__':
    pass
# A function handle, that is used to evaluate the performance of a run.
_PERFORMANCE_EVAL_HANDLE = hpsplit._performance_criteria

# A key that must appear in the `_SUMMARY_KEYWORDS` list. If `None`, the first
# entry in this list will be selected.
# The CSV file will be sorted based on this keyword. See also attribute
# `_PERFORMANCE_SORT_ASC`.
_PERFORMANCE_KEY = 'acc_avg_final'
assert(_PERFORMANCE_KEY is None or _PERFORMANCE_KEY in _SUMMARY_KEYWORDS)
# Whether the CSV should be sorted ascending or descending based on the
# `_PERFORMANCE_KEY`.
_PERFORMANCE_SORT_ASC = False

# FIXME: This attribute will vanish in future releases.
# This attribute is only required by the `hpsearch_postprocessing` script.
# A function handle to the argument parser function used by the simulation
# script. The function handle should expect the list of command line options
# as only parameter.
# Example:
# >>> from probabilistic.prob_mnist import train_args as targs
# >>> f = lambda argv : targs.parse_cmd_arguments(mode='split_mnist_bbb',
# ...                                             argv=argv)
# >>> _ARGPARSE_HANDLE = f
import probabilistic.ewc_args as targs
_ARGPARSE_HANDLE = lambda argv : targs.parse_cmd_arguments( \
    mode='gmm_ewc', argv=argv)

if __name__ == '__main__':
    pass

Beispiel #4
0
# A function handle, that is used to evaluate the performance of a run.
_PERFORMANCE_EVAL_HANDLE = hpsplit._performance_criteria

# A key that must appear in the `_SUMMARY_KEYWORDS` list. If `None`, the first
# entry in this list will be selected.
# The CSV file will be sorted based on this keyword. See also attribute
# `_PERFORMANCE_SORT_ASC`.
_PERFORMANCE_KEY = 'acc_avg_final'
assert (_PERFORMANCE_KEY is None or _PERFORMANCE_KEY in _SUMMARY_KEYWORDS)
# Whether the CSV should be sorted ascending or descending based on the
# `_PERFORMANCE_KEY`.
_PERFORMANCE_SORT_ASC = False

# FIXME: This attribute will vanish in future releases.
# This attribute is only required by the `hpsearch_postprocessing` script.
# A function handle to the argument parser function used by the simulation
# script. The function handle should expect the list of command line options
# as only parameter.
# Example:
# >>> from probabilistic.prob_mnist import train_args as targs
# >>> f = lambda argv : targs.parse_cmd_arguments(mode='split_mnist_bbb',
# ...                                             argv=argv)
# >>> _ARGPARSE_HANDLE = f
import probabilistic.ewc_args as targs
_ARGPARSE_HANDLE = lambda argv : targs.parse_cmd_arguments( \
    mode='perm_mnist_ewc', argv=argv)

if __name__ == '__main__':
    pass
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# @title          :probabilistic/prob_mnist/train_perm_ewc.py
# @author         :ch
# @contact        :[email protected]
# @created        :01/10/2021
# @version        :1.0
# @python_version :3.8.5
"""
PermutedMNIST with EWC
----------------------

This script is used to run EWC experiments on PermutedMNIST.
"""
# Do not delete the following import for all executable scripts!
import __init__  # pylint: disable=unused-import

from probabilistic import ewc_args
from probabilistic import ewc_utils

if __name__ == '__main__':
    config = ewc_args.parse_cmd_arguments(mode='perm_mnist_ewc')

    ewc_utils.run(config, experiment='perm_mnist_ewc')
Beispiel #6
0
    """
    performance = float(summary_dict['aa_mse_final_inferred_mean'][0])
    return performance < performance_criteria

_PERFORMANCE_EVAL_HANDLE = _performance_criteria

_PERFORMANCE_KEY = 'aa_mse_final_inferred_mean'
assert(_PERFORMANCE_KEY is None or _PERFORMANCE_KEY in _SUMMARY_KEYWORDS)
# Whether the CSV should be sorted ascending or descending based on the
# `_PERFORMANCE_KEY`.
_PERFORMANCE_SORT_ASC = True

# FIXME: This attribute will vanish in future releases.
# This attribute is only required by the `hpsearch_postprocessing` script.
# A function handle to the argument parser function used by the simulation
# script. The function handle should expect the list of command line options
# as only parameter.
# Example:
# >>> from probabilistic.prob_mnist import train_args as targs
# >>> f = lambda argv : targs.parse_cmd_arguments(mode='split_mnist_bbb',
# ...                                             argv=argv)
# >>> _ARGPARSE_HANDLE = f
import probabilistic.ewc_args as targs
_ARGPARSE_HANDLE = lambda argv : targs.parse_cmd_arguments( \
    mode='regression_ewc', argv=argv)

if __name__ == '__main__':
    pass


#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# @title          :probabilistic/prob_cifar/train_resnet_ewc.py
# @author         :ch
# @contact        :[email protected]
# @created        :01/10/2021
# @version        :1.0
# @python_version :3.8.5
"""
SplitCIFAR with EWC
-------------------

This script is used to run EWC experiments on SplitCIFAR.
"""
# Do not delete the following import for all executable scripts!
import __init__ # pylint: disable=unused-import

from probabilistic import ewc_args
from probabilistic import ewc_utils

if __name__ == '__main__':
    config = ewc_args.parse_cmd_arguments(mode='cifar_resnet_ewc')

    ewc_utils.run(config, experiment='cifar_resnet_ewc')

#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# @title          :probabilistic/prob_gmm/train_gmm_ewc.py
# @author         :ch
# @contact        :[email protected]
# @created        :01/10/2021
# @version        :1.0
# @python_version :3.8.5
"""
GMM CL Classification Experiment with EWC
-----------------------------------------

This script is used to run EWC experiments on the GMM datasets.
"""
# Do not delete the following import for all executable scripts!
import __init__  # pylint: disable=unused-import

from probabilistic import ewc_args
from probabilistic import ewc_utils

if __name__ == '__main__':
    config = ewc_args.parse_cmd_arguments(mode='gmm_ewc')

    ewc_utils.run(config, experiment='gmm_ewc')