-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from NxNiki/dev
add analysis
- Loading branch information
Showing
31 changed files
with
2,201 additions
and
1,101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
results/**/*.html filter=lfs diff=lfs merge=lfs -text |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<component name="ProjectRunConfigurationManager"> | ||
<configuration default="false" name="run_twilight_merge" type="PythonConfigurationType" factoryName="Python"> | ||
<module name="brain_decoding" /> | ||
<option name="ENV_FILES" value="" /> | ||
<option name="INTERPRETER_OPTIONS" value="" /> | ||
<option name="PARENT_ENVS" value="true" /> | ||
<envs> | ||
<env name="PYTHONUNBUFFERED" value="1" /> | ||
</envs> | ||
<option name="SDK_HOME" value="" /> | ||
<option name="SDK_NAME" value="movie_decoding" /> | ||
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" /> | ||
<option name="IS_MODULE_SDK" value="false" /> | ||
<option name="ADD_CONTENT_ROOTS" value="true" /> | ||
<option name="ADD_SOURCE_ROOTS" value="true" /> | ||
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/src/scripts/run_model_twilight_merge.py" /> | ||
<option name="PARAMETERS" value="" /> | ||
<option name="SHOW_COMMAND_LINE" value="false" /> | ||
<option name="EMULATE_TERMINAL" value="false" /> | ||
<option name="MODULE_MODE" value="false" /> | ||
<option name="REDIRECT_INPUT" value="false" /> | ||
<option name="INPUT_FILE" value="" /> | ||
<method v="2" /> | ||
</configuration> | ||
</component> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<component name="ProjectRunConfigurationManager"> | ||
<configuration default="false" name="run_twilight_vs_24" type="PythonConfigurationType" factoryName="Python"> | ||
<module name="brain_decoding" /> | ||
<option name="ENV_FILES" value="" /> | ||
<option name="INTERPRETER_OPTIONS" value="" /> | ||
<option name="PARENT_ENVS" value="true" /> | ||
<envs> | ||
<env name="PYTHONUNBUFFERED" value="1" /> | ||
</envs> | ||
<option name="SDK_HOME" value="" /> | ||
<option name="SDK_NAME" value="movie_decoding" /> | ||
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" /> | ||
<option name="IS_MODULE_SDK" value="false" /> | ||
<option name="ADD_CONTENT_ROOTS" value="true" /> | ||
<option name="ADD_SOURCE_ROOTS" value="true" /> | ||
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/src/scripts/run_model_twilight_vs_24.py" /> | ||
<option name="PARAMETERS" value="" /> | ||
<option name="SHOW_COMMAND_LINE" value="false" /> | ||
<option name="EMULATE_TERMINAL" value="false" /> | ||
<option name="MODULE_MODE" value="false" /> | ||
<option name="REDIRECT_INPUT" value="false" /> | ||
<option name="INPUT_FILE" value="" /> | ||
<method v="2" /> | ||
</configuration> | ||
</component> |
3 changes: 3 additions & 0 deletions
3
...ght_merged/570_None_multi-vit_test_optimalX_CARX_2024-11-12_11-57-23/plot_activation.html
Git LFS file not shown
3 changes: 3 additions & 0 deletions
3
...ight_vs_24/570_None_multi-vit_test_optimalX_CARX_2024-11-08_18-37-47/plot_activation.html
Git LFS file not shown
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
from pydantic import BaseModel | ||
|
||
|
||
class Config(BaseModel): | ||
class Config: | ||
# arbitrary_types_allowed = True | ||
extra = "allow" # Allow arbitrary attributes | ||
|
||
_list_fields = set() # A set to track which fields should be treated as lists | ||
|
||
def ensure_list(self, name: str): | ||
value = getattr(self, name, None) | ||
if value is not None and not isinstance(value, list): | ||
setattr(self, name, [value]) | ||
# Mark the field to always be treated as a list | ||
self._list_fields.add(name) | ||
|
||
def __setattr__(self, name, value): | ||
if name in self._list_fields and not isinstance(value, list): | ||
# Automatically convert to a list if it's in the list fields | ||
value = [value] | ||
super().__setattr__(name, value) | ||
|
||
|
||
class SupConfig(Config): | ||
pass | ||
|
||
|
||
# Example usage | ||
config = SupConfig() | ||
|
||
# Dynamically adding attributes | ||
config.param1 = "a" | ||
|
||
# Ensuring param1 is a list | ||
config.ensure_list("param1") | ||
print(config.param1) # Output: ['a'] | ||
|
||
# Assigning new value to param1 | ||
config.param1 = "ab" | ||
print(config.param1) # Output: ['ab'] gets automatically converted to ['ab'] | ||
|
||
# Adding another parameter and ensuring it's a list | ||
config.ensure_list("param2") | ||
config.param2 = 123 | ||
print(config.param2) # Output: [123] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
from typing import Any, Dict, Set | ||
|
||
from pydantic import BaseModel, Field | ||
|
||
|
||
class BaseConfig(BaseModel): | ||
class Config: | ||
extra = "allow" # Allow arbitrary attributes | ||
|
||
def __init__(self, **data: Any) -> None: | ||
super().__init__(**data) | ||
self.__dict__["_list_fields"]: Set[str] = set() | ||
self.__dict__["_alias"]: Dict[str, str] = {} | ||
|
||
def __getitem__(self, key: str) -> Any: | ||
return getattr(self, key) | ||
|
||
def __setitem__(self, key: str, value: Any): | ||
setattr(self, key, value) | ||
|
||
def __getattr__(self, name): | ||
"""Handles alias access and custom parameters.""" | ||
if name in self._alias: | ||
return getattr(self, self._alias[name]) | ||
|
||
def __setattr__(self, name, value): | ||
"""Handles alias assignment, field setting, or adding to _param.""" | ||
if name in self._alias: | ||
name = self._alias[name] | ||
if name in self._list_fields and not isinstance(value, list): | ||
value = [value] | ||
super().__setattr__(name, value) | ||
|
||
def __contains__(self, key: str) -> bool: | ||
return hasattr(self, key) | ||
|
||
def __repr__(self): | ||
attrs = {k: v for k, v in self.__dict__.items() if not k.startswith("_")} | ||
attr_str = "\n".join(f" {key}: {value!r}" for key, value in attrs.items()) | ||
return f"{self.__class__.__name__}(\n{attr_str}\n)" | ||
|
||
def set_alias(self, name: str, alias: str) -> None: | ||
self.__dict__["_alias"][alias] = name | ||
|
||
def ensure_list(self, name: str): | ||
"""Mark the field to always be treated as a list""" | ||
value = getattr(self, name, None) | ||
if value is not None and not isinstance(value, list): | ||
setattr(self, name, [value]) | ||
self._list_fields.add(name) | ||
|
||
|
||
class Foo(BaseConfig): | ||
a: int = 1 | ||
|
||
class Config: | ||
extra = "allow" | ||
|
||
|
||
print(Foo(**{"a": 1, "b": 2}).model_dump()) # == {'a': 1, 'b': 2} | ||
|
||
foo = Foo() | ||
foo.b = 2 | ||
print(foo.model_dump()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.