Skip to content

Commit

Permalink
Minor changes to default arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
wi-re committed Aug 29, 2024
1 parent 0ddec05 commit 9927a27
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/BasisConvolution/util/arguments.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@
parser.add_argument('--independent_dxdt', type = bool, default = argparse.SUPPRESS, action=argparse.BooleanOptionalAction, help='dxdt predicts velocity as well')
parser.add_argument('--networkType', type = str, default = argparse.SUPPRESS, help='Shifting the loop')

parser.add_argument('--lossTerms', type = str, default = argparse.SUPPRESS, help='Loss terms')

parser.add_argument('--dataIndex', type = str, default = argparse.SUPPRESS, help='Data override')
# dxdtLossScaling
parser.add_argument('--dxdtLossScaling', type = float, default = argparse.SUPPRESS, help='Data override')
Expand Down
8 changes: 6 additions & 2 deletions src/BasisConvolution/util/hyperparameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def defaultHyperParameters():
'shiftLoss': False,
'activation': 'relu',
'dataIndex': '',
'dxdtLossScaling': 1,
'dxdtLossScaling': 2,
'exportPath': 'experiments',
'arch':'',
'scaleShiftLoss': False,
Expand All @@ -68,6 +68,7 @@ def defaultHyperParameters():
'vertexMLP': None,
'shiftCFL': 10,
'shiftIters': 1,
'lossTerms': 'both',
'integrationScheme': 'semiImplicitEuler',
}
return hyperParameterDict
Expand All @@ -81,7 +82,7 @@ def parseArguments(args, hyperParameterDict):
hyperParameterDict['initialLR'] = args.lr if hasattr(args, 'lr') else hyperParameterDict['initialLR']
hyperParameterDict['finalLR'] = args.finalLR if hasattr(args, 'finalLR') else hyperParameterDict['finalLR']
hyperParameterDict['lrStep'] = args.lrStep if hasattr(args, 'lrStep') else hyperParameterDict['lrStep']

hyperParameterDict['lossTerms'] = args.lossTerms if hasattr(args, 'lossTerms') else hyperParameterDict['lossTerms']

hyperParameterDict['epochs'] = args.epochs if hasattr(args, 'epochs') else hyperParameterDict['epochs']
hyperParameterDict['frameDistance'] = args.frameDistance if hasattr(args, 'frameDistance') else hyperParameterDict['frameDistance']
Expand Down Expand Up @@ -256,6 +257,7 @@ def parseConfig(config, hyperParameterDict):

parseEntry(cfg, 'loss', 'li', hyperParameterDict, 'liLoss')
parseEntry(cfg, 'loss', 'loss', hyperParameterDict, 'loss')
parseEntry(cfg, 'loss', 'lossTerms', hyperParameterDict, 'lossTerms')
parseEntry(cfg, 'network', 'ff', hyperParameterDict, 'fluidFeatures')
parseEntry(cfg, 'network', 'bf', hyperParameterDict, 'boundaryFeatures')
parseEntry(cfg, 'network', 'gt', hyperParameterDict, 'groundTruth')
Expand Down Expand Up @@ -382,6 +384,8 @@ def toPandaDict(hyperParameterDict):
'layers': hyperParameterDict['layers'],
'seed': hyperParameterDict['seed'],

'lossTerms': hyperParameterDict['lossTerms'],

'windowFunction': hyperParameterDict['windowFunction'] if hyperParameterDict['windowFunction'] is not None else 'None',
'coordinateMapping' : hyperParameterDict['coordinateMapping'],

Expand Down

0 comments on commit 9927a27

Please sign in to comment.