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

Fix typos #12

Merged
merged 1 commit into from
Apr 26, 2022
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
Fix typos
  • Loading branch information
kianmeng committed Apr 20, 2022
commit 191da9c81bde123704729165af4915ac4414019a
2 changes: 1 addition & 1 deletion docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ For each standard type values are converted to the type using the type as constr

When using the collection definition from `typing` the inner types will also be checked recursively. For example, one can define a `#!python typing.Tuple[int,float,typing.List[int]]` type and the conversion will be done accordingly.

Reading sequences and dictionaries is done using the `yaml` syntax. Notice that tuples and sets use the same syntax as lists, where the conversion happens after loading the arguments. For dictionaries, the keys must be space seperated so the entire dictionary should be wrapped in string quotation marks.
Reading sequences and dictionaries is done using the `yaml` syntax. Notice that tuples and sets use the same syntax as lists, where the conversion happens after loading the arguments. For dictionaries, the keys must be space separated so the entire dictionary should be wrapped in string quotation marks.

```console
$ python train_model.py --worker_inds=[2,18,42] --worker_names="{2: 'George', 18: 'Ben'}"
Expand Down
6 changes: 3 additions & 3 deletions pyrallis/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def get_item_type(container_type: Type[Container[T]]) -> T:

def _mro(t: Type) -> List[Type]:
# TODO: This is mostly used in 'is_tuple' and such, and should be replaced with
# either the build-in 'get_origin' from typing, or from typing-inspect.
# either the built-in 'get_origin' from typing, or from typing-inspect.
if t is None:
return []
if hasattr(t, "__mro__"):
Expand Down Expand Up @@ -121,13 +121,13 @@ def is_set(t: Type) -> bool:


def is_dataclass_type(t: Type) -> bool:
"""Returns wether t is a dataclass type or a TypeVar of a dataclass type.
"""Returns whether t is a dataclass type or a TypeVar of a dataclass type.

Args:
t (Type): Some type.

Returns:
bool: Wether its a dataclass type.
bool: Whether its a dataclass type.
"""
return dataclasses.is_dataclass(t) or (
tpi.is_typevar(t) and dataclasses.is_dataclass(tpi.get_bound(t))
Expand Down
2 changes: 1 addition & 1 deletion pyrallis/wrappers/docstring.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def get_attribute_docstring(


def _contains_attribute_definition(line_str: str) -> bool:
"""Returns wether or not a line contains a an dataclass field definition.
"""Returns whether or not a line contains a an dataclass field definition.

Arguments:
line_str {str} -- the line content
Expand Down
2 changes: 1 addition & 1 deletion pyrallis/wrappers/field_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def arg_options(self) -> Dict[str, Any]:
well as Python's type annotations.

By passing additional keyword arguments to the `field()`
function, the autogenerated arguments can be overwriten,
function, the autogenerated arguments can be overwritten,
giving access to all of the usual argparse features know and love.

NOTE: When passing an `action` keyword argument, we remove all the
Expand Down
2 changes: 1 addition & 1 deletion pyrallis/wrappers/wrapper.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Abstact Wrapper base-class for the FieldWrapper and DataclassWrapper."""
"""Abstract Wrapper base-class for the FieldWrapper and DataclassWrapper."""

from abc import ABC, abstractmethod
from typing import Generic, Optional, List
Expand Down
12 changes: 6 additions & 6 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,18 +129,18 @@ class TaskHyperParameters(TestSetup):
num_units: int = 8 # units per layer
activation: Activations = field(default=Activations.TANH) # activation function
use_batchnorm: bool = (
False # wether or not to use batch normalization after each dense layer
False # whether or not to use batch normalization after each dense layer
)
use_dropout: bool = True # wether or not to use dropout after each dense layer
use_dropout: bool = True # whether or not to use dropout after each dense layer
dropout_rate: float = 0.1 # the dropout rate
use_image_features: bool = (
True # wether or not image features should be used as input
True # whether or not image features should be used as input
)
use_likes: bool = True # wether or not 'likes' features should be used as input
use_likes: bool = True # whether or not 'likes' features should be used as input
l1_reg: float = 0.005 # L1 regularization coefficient
l2_reg: float = 0.005 # L2 regularization coefficient

# Wether or not a task-specific Embedding layer should be used on the 'likes' features.
# Whether or not a task-specific Embedding layer should be used on the 'likes' features.
# When set to 'True', it is expected that there no shared embedding is used.
embed_likes: bool = False

Expand Down Expand Up @@ -177,7 +177,7 @@ class HyperParameters(TestSetup):

shared_likes_embedding: bool = True

# Wether or not to better filtering of liked pages
# Whether or not to better filtering of liked pages
use_custom_likes: bool = True

# Gender model settings
Expand Down