Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

60 remove multi dim categoricals #70

Merged
merged 9 commits into from
Feb 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
* fixed DataBool (#68)
* fixed GetOneSample (#68)
* removed option to specify dimensions in DataBool and DataCategorical components (#60), to align with bug fixes in AIXD

### Removed

Expand Down
49 changes: 32 additions & 17 deletions docs/documentation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,12 @@ DataBool
:height: 24
:width: 24

Defines a boolean variable.
Defines a boolean variable (`True` or `False`).


**Inputs**

- **name** *(str)* -- Name of the variable.
- **dim** *(int)* -- Dimension of the variable.

**Outputs**

Expand All @@ -34,13 +33,12 @@ DataCategorical
:height: 24
:width: 24

Defines a categorical variable.
Defines a categorical variable (for example, represening labels or classes).


**Inputs**

- **name** *(str)* -- Name of the variable.
- **dim** *(int)* -- Dimension of the variable.
- **options** *[List of (str)]* -- Options: list of possible categories, as strings.

**Outputs**
Expand Down Expand Up @@ -128,7 +126,8 @@ DatasetGenerator
:height: 24
:width: 24

Provides instructions on how to generate random samples for the dataset.
Provides instructions on how to generate random samples for the dataset by harnessing the parametric model found in the current Grasshopper file.
See Tutorial for more information on how to prepare the inputs and outputs of the parametric model.


**Outputs**
Expand Down Expand Up @@ -160,7 +159,8 @@ DatasetOneSample
:height: 24
:width: 24

Retrieves one sample from the dataset (at a given or random index) and instantiates it in the parametric model.
Retrieves one sample from the dataset (at a given or random index) and instantiates it in the parametric model.
Requires a dataset to be loaded.


**Inputs**
Expand Down Expand Up @@ -200,7 +200,8 @@ DatasetSummary
:height: 24
:width: 24

Provides a summary of the dataset.
Provides a summary of the dataset.
Requires a dataset to be loaded.


**Inputs**
Expand All @@ -218,7 +219,8 @@ Generator
:height: 24
:width: 24

Runs a generation campaing to create new designs using the trained model.
Runs a generation campaing to create new designs using the trained model.
Requires a dataset and a trained model to be loaded.


**Inputs**
Expand All @@ -241,7 +243,8 @@ ModelDimensions
:height: 24
:width: 24

Retrieves dimensions of the model's input and output layers.
Retrieves dimensions of the model's input and output layers.
Requires that a model has been set up or loaded.


**Inputs**
Expand All @@ -259,7 +262,8 @@ ModelLoad
:height: 24
:width: 24

Loads an existing, pre-traind neural network model from a checkpoint.
Loads an existing, pre-traind neural network model from a checkpoint.
Requires a dataset to be loaded.


**Inputs**
Expand All @@ -280,7 +284,8 @@ ModelSetup
:height: 24
:width: 24

Sets up an autoencoder model of the specified type with the given parameters.
Sets up an autoencoder model of the specified type with the given parameters.
Requires a dataset to be loaded.


**Inputs**
Expand All @@ -305,7 +310,8 @@ ModelSummary
:height: 24
:width: 24

Provides a summary of the autoencoder model's architecture.
Provides a summary of the autoencoder model's architecture.
Requires that a model has been set up or loaded.


**Inputs**
Expand All @@ -324,7 +330,8 @@ ModelTrain
:height: 24
:width: 24

Runs a training campaign.
Runs a training campaign.
Requires that a model has been set up (to train from scratch) or loaded (to continue training).


**Inputs**
Expand All @@ -345,7 +352,9 @@ PlotContours
:height: 24
:width: 24

Plots the distribution contours for each pair of variables from the data in the dataset.
Plots the distribution contours for each pair of variables from the data in the dataset.
Launches an interactive plot in a browser.
Requires a dataset to be loaded.


**Inputs**
Expand All @@ -360,7 +369,9 @@ PlotContoursRequest
:height: 24
:width: 24

Plots the predicted values of the requested designs against the distribution contours for each pair of the corresponding variables.
Plots the predicted values of the requested designs against the distribution contours for each pair of the corresponding variables.
Launches an interactive plot in a browser.
Requires that a request has been made and designs have been generated.


**Inputs**
Expand All @@ -374,7 +385,9 @@ PlotCorrelations
:height: 24
:width: 24

Plots correlation matrix for the given variables from the data in the dataset.
Plots correlation matrix for the given variables from the data in the dataset.
Launches an interactive plot in a browser.
Requires a dataset to be loaded.


**Inputs**
Expand All @@ -389,7 +402,9 @@ PlotDistribution
:height: 24
:width: 24

Plots the distribution of the given variables from the data in the dataset.
Plots the distribution of the given variables from the data in the dataset.
Launches an interactive plot in a browser.
Requires a dataset to be loaded.


**Inputs**
Expand Down
5 changes: 1 addition & 4 deletions src/aixd_ara/components/ara_DataBool/code.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
# flake8: noqa
from aixd_ara.wrappers import WrapperShallowDataObject

if not dim or dim < 1:
dim = 1


dobj = {"datatype": "DataBool", "name": name, "dim": dim}
dobj = {"datatype": "DataBool", "name": name, "dim": 1}


dataobject = WrapperShallowDataObject(dobj)
9 changes: 1 addition & 8 deletions src/aixd_ara/components/ara_DataBool/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"nickname": "DataBool",
"category": "ARA",
"subcategory": "1 Data",
"description": "Defines a boolean variable.",
"description": "Defines a boolean variable (`True` or `False`).",
"exposure": 2,
"ghpython": {
"isAdvancedMode": false,
Expand All @@ -14,14 +14,7 @@
"description": "Name of the variable.",
"typeHintID": "str",
"scriptParamAccess": 0
},
{
"name": "dim",
"description": "Dimension of the variable.",
"typeHintID": "int",
"scriptParamAccess": 0
}

],

"outputParameters": [
Expand Down
4 changes: 1 addition & 3 deletions src/aixd_ara/components/ara_DataCat/code.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
# flake8: noqa
from aixd_ara.wrappers import WrapperShallowDataObject

if not dim or dim < 1:
dim = 1

if not options:
options = None
else:
options = [str(x) for x in options]


dobj = {"datatype": "DataCategorical", "name": name, "dim": dim, "domain": options}
dobj = {"datatype": "DataCategorical", "name": name, "dim": 1, "domain": options}

dataobject = WrapperShallowDataObject(dobj)
8 changes: 1 addition & 7 deletions src/aixd_ara/components/ara_DataCat/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"nickname": "DataCat",
"category": "ARA",
"subcategory": "1 Data",
"description": "Defines a categorical variable.",
"description": "Defines a categorical variable (for example, represening labels or classes).",
"exposure": 2,
"ghpython": {
"isAdvancedMode": false,
Expand All @@ -15,12 +15,6 @@
"typeHintID": "str",
"scriptParamAccess": 0
},
{
"name": "dim",
"description": "Dimension of the variable.",
"typeHintID": "int",
"scriptParamAccess": 0
},
{
"name": "options",
"description": "Options: list of possible categories, as strings.",
Expand Down
3 changes: 3 additions & 0 deletions src/aixd_ara/components/ara_DatasetCreate/code.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# flake8: noqa
from scriptcontext import sticky as st
from Grasshopper.Kernel.GH_RuntimeMessageLevel import Warning

from aixd_ara.gh_ui import create_dataset_object
from aixd_ara.gh_ui_helper import component_id
Expand All @@ -17,3 +18,5 @@

if cid in st.keys():
msg = st[cid]["msg"]
if st[cid]["status"]=="warning":
ghenv.Component.AddRuntimeMessage(Warning, msg)
2 changes: 1 addition & 1 deletion src/aixd_ara/components/ara_DatasetGenerator/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"nickname": "DatasetGen",
"category": "ARA",
"subcategory": "2 Dataset",
"description": "Provides instructions on how to generate random samples for the dataset.",
"description": "Provides instructions on how to generate random samples for the dataset by harnessing the parametric model found in the current Grasshopper file. \nSee Tutorial for more information on how to prepare the inputs and outputs of the parametric model.",
"exposure": 2,
"ghpython": {
"isAdvancedMode": false,
Expand Down
2 changes: 1 addition & 1 deletion src/aixd_ara/components/ara_DatasetOneSample/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"nickname": "DatasetOneSample",
"category": "ARA",
"subcategory": "2 Dataset",
"description": "Retrieves one sample from the dataset (at a given or random index) and instantiates it in the parametric model.",
"description": "Retrieves one sample from the dataset (at a given or random index) and instantiates it in the parametric model. \nRequires a dataset to be loaded.",
"exposure": 4,
"ghpython": {
"isAdvancedMode": false,
Expand Down
2 changes: 1 addition & 1 deletion src/aixd_ara/components/ara_DatasetSummary/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"nickname": "DatasetSummary",
"category": "ARA",
"subcategory": "2 Dataset",
"description": "Provides a summary of the dataset.",
"description": "Provides a summary of the dataset. \nRequires a dataset to be loaded.",
"exposure": 4,
"ghpython": {
"isAdvancedMode": false,
Expand Down
2 changes: 1 addition & 1 deletion src/aixd_ara/components/ara_Generator/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"nickname": "Generator",
"category": "ARA",
"subcategory": "4 Generator",
"description": "Runs a generation campaing to create new designs using the trained model.",
"description": "Runs a generation campaing to create new designs using the trained model. \nRequires a dataset and a trained model to be loaded.",
"exposure": 2,
"ghpython": {
"isAdvancedMode": false,
Expand Down
2 changes: 1 addition & 1 deletion src/aixd_ara/components/ara_ModelDims/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"nickname": "ModelDims",
"category": "ARA",
"subcategory": "3 Model",
"description": "Retrieves dimensions of the model's input and output layers.",
"description": "Retrieves dimensions of the model's input and output layers. \nRequires that a model has been set up or loaded.",
"exposure": 4,
"ghpython": {
"isAdvancedMode": false,
Expand Down
2 changes: 1 addition & 1 deletion src/aixd_ara/components/ara_ModelLoad/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"nickname": "ModelLoad",
"category": "ARA",
"subcategory": "3 Model",
"description": "Loads an existing, pre-traind neural network model from a checkpoint.",
"description": "Loads an existing, pre-traind neural network model from a checkpoint. \nRequires a dataset to be loaded.",
"exposure": 2,
"ghpython": {
"isAdvancedMode": false,
Expand Down
2 changes: 1 addition & 1 deletion src/aixd_ara/components/ara_ModelSetup/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"nickname": "ModelSetup",
"category": "ARA",
"subcategory": "3 Model",
"description": "Sets up an autoencoder model of the specified type with the given parameters.",
"description": "Sets up an autoencoder model of the specified type with the given parameters. \nRequires a dataset to be loaded.",
"exposure": 2,
"ghpython": {
"isAdvancedMode": false,
Expand Down
2 changes: 1 addition & 1 deletion src/aixd_ara/components/ara_ModelSummary/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"nickname": "ModelSummary",
"category": "ARA",
"subcategory": "3 Model",
"description": "Provides a summary of the autoencoder model's architecture.",
"description": "Provides a summary of the autoencoder model's architecture. \nRequires that a model has been set up or loaded.",
"exposure": 4,
"ghpython": {
"isAdvancedMode": false,
Expand Down
2 changes: 1 addition & 1 deletion src/aixd_ara/components/ara_ModelTrain/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"nickname": "ModelTrain",
"category": "ARA",
"subcategory": "3 Model",
"description": "Runs a training campaign.",
"description": "Runs a training campaign. \nRequires that a model has been set up (to train from scratch) or loaded (to continue training).",
"exposure": 2,
"ghpython": {
"isAdvancedMode": false,
Expand Down
2 changes: 1 addition & 1 deletion src/aixd_ara/components/ara_PlotContours/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"nickname": "PlotContours",
"category": "ARA",
"subcategory": "5 Plotter",
"description": "Plots the distribution contours for each pair of variables from the data in the dataset.",
"description": "Plots the distribution contours for each pair of variables from the data in the dataset. \nLaunches an interactive plot in a browser. \nRequires a dataset to be loaded.",
"exposure": 2,
"ghpython": {
"isAdvancedMode": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"nickname": "PlotContReq",
"category": "ARA",
"subcategory": "5 Plotter",
"description": "Plots the predicted values of the requested designs against the distribution contours for each pair of the corresponding variables.",
"description": "Plots the predicted values of the requested designs against the distribution contours for each pair of the corresponding variables. \nLaunches an interactive plot in a browser. \nRequires that a request has been made and designs have been generated.",
"exposure": 2,
"ghpython": {
"isAdvancedMode": false,
Expand Down
2 changes: 1 addition & 1 deletion src/aixd_ara/components/ara_PlotCorrelations/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"nickname": "PlotCorrelations",
"category": "ARA",
"subcategory": "5 Plotter",
"description": "Plots correlation matrix for the given variables from the data in the dataset.",
"description": "Plots correlation matrix for the given variables from the data in the dataset. \nLaunches an interactive plot in a browser. \nRequires a dataset to be loaded.",
"exposure": 2,
"ghpython": {
"isAdvancedMode": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"nickname": "PlotDistribution",
"category": "ARA",
"subcategory": "5 Plotter",
"description": "Plots the distribution of the given variables from the data in the dataset.",
"description": "Plots the distribution of the given variables from the data in the dataset. \nLaunches an interactive plot in a browser. \nRequires a dataset to be loaded.",
"exposure": 2,
"ghpython": {
"isAdvancedMode": false,
Expand Down
Loading