Coverage for src/meta_learning/meta_learning_modules/few_shot_modules/__init__.py: 100%

5 statements  

« prev     ^ index     » next       coverage.py v7.10.5, created at 2025-09-03 12:35 +0900

1""" 

2Few-Shot Learning Modules Package 

3================================= 

4 

5Modular implementation of advanced few-shot learning algorithms 

6broken down from the original 1427-line monolithic file. 

7 

8Modules: 

9- configurations.py: Configuration dataclasses for all algorithms 

10- core_networks.py: Main neural network architectures  

11- advanced_components.py: Multi-scale features, attention, uncertainty 

12- utilities.py: Factory functions, evaluation utilities 

13""" 

14 

15from .configurations import ( 

16 FewShotConfig, 

17 PrototypicalConfig, 

18 MatchingConfig, 

19 RelationConfig 

20) 

21 

22from .core_networks import ( 

23 PrototypicalNetworks, 

24 SimplePrototypicalNetworks, 

25 MatchingNetworks, 

26 RelationNetworks 

27) 

28 

29from .advanced_components import ( 

30 MultiScaleFeatureAggregator, 

31 PrototypeRefiner, 

32 UncertaintyEstimator, 

33 ScaledDotProductAttention, 

34 AdditiveAttention, 

35 BilinearAttention, 

36 GraphRelationModule, 

37 StandardRelationModule, 

38 UncertaintyAwareDistance, 

39 HierarchicalPrototypes, 

40 TaskAdaptivePrototypes 

41) 

42 

43from .utilities import ( 

44 create_prototypical_network, 

45 compare_with_learn2learn_protonet, 

46 evaluate_on_standard_benchmarks 

47) 

48 

49__all__ = [ 

50 # Configurations 

51 'FewShotConfig', 

52 'PrototypicalConfig', 

53 'MatchingConfig', 

54 'RelationConfig', 

55 

56 # Core Networks 

57 'PrototypicalNetworks', 

58 'SimplePrototypicalNetworks', 

59 'MatchingNetworks', 

60 'RelationNetworks', 

61 

62 # Advanced Components 

63 'MultiScaleFeatureAggregator', 

64 'PrototypeRefiner', 

65 'UncertaintyEstimator', 

66 'ScaledDotProductAttention', 

67 'AdditiveAttention', 

68 'BilinearAttention', 

69 'GraphRelationModule', 

70 'StandardRelationModule', 

71 'UncertaintyAwareDistance', 

72 'HierarchicalPrototypes', 

73 'TaskAdaptivePrototypes', 

74 

75 # Utilities 

76 'create_prototypical_network', 

77 'compare_with_learn2learn_protonet', 

78 'evaluate_on_standard_benchmarks' 

79]