Skip to content

Commit

Permalink
dev(narugo): optimize from mean vector
Browse files Browse the repository at this point in the history
  • Loading branch information
narugo1992 committed Apr 28, 2024
1 parent 65b6065 commit cb93e08
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ccip_merge/measure.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def objective_function(x):
total_similarity += np.dot(x, vector) / (np.linalg.norm(x) * np.linalg.norm(vector))
return -total_similarity / embs.shape[0]

initial_guess = np.random.rand(768)
initial_guess = embs.mean(axis=0)
constraints = ({'type': 'eq', 'fun': lambda x: np.linalg.norm(x) - 1.0})
result = minimize(
objective_function, initial_guess,
Expand Down

0 comments on commit cb93e08

Please sign in to comment.