Skip to content

Commit

Permalink
Merge branch 'dev-2.0.0-beta-debugging' of https://github.com/Federat…
Browse files Browse the repository at this point in the history
…edAI/FATE into dev-2.0.0-beta-debugging
  • Loading branch information
nemirorox committed Jul 5, 2023
2 parents 1aa1998 + d96fe50 commit 9b04cfc
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
3 changes: 3 additions & 0 deletions python/fate/arch/tensor/distributed/_tensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ def __matmul__(self, other):
def __rmatmul__(self, other):
return torch.matmul(other, self)

def encrypt(self, encryptor):
return torch.encrypt_f(self, encryptor)

@property
def shape(self):
return self.shardings.shape
Expand Down
2 changes: 1 addition & 1 deletion python/fate/components/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#

"""
execute with python -m fate.components --execution_id xxx --config xxx
execute with python -m fate.components --config xxx
"""

if __name__ == "__main__":
Expand Down
12 changes: 8 additions & 4 deletions python/fate/components/core/params/_optimizer.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
from typing import Type

import pydantic

from ._fields import string_choice
from ._penalty import penalty_param


class OptimizerParam(pydantic.BaseModel):
method: string_choice(['sgd', 'adadelta', 'adagrad', 'adam', 'adamax', 'adamw',
'asgd', 'nadam', 'radam', 'rmsprop', 'rprop']) = 'sgd'
penalty: penalty_param(l1=True, l2=True, none=True) = 'l2'
method: string_choice(
["sgd", "adadelta", "adagrad", "adam", "adamax", "adamw", "asgd", "nadam", "radam", "rmsprop", "rprop"]
) = "sgd"
penalty: penalty_param(l1=True, l2=True, none=True) = "l2"
alpha: float = 1.0
optimizer_params: dict

def optimizer_param():

def optimizer_param() -> Type[OptimizerParam]:
namespace = {}
return type("OptimizerParam", (OptimizerParam,), namespace)

0 comments on commit 9b04cfc

Please sign in to comment.